GithubHelp home page GithubHelp logo

Comments (6)

djett41 avatar djett41 commented on August 23, 2024

Can you post the code you are using in your call to filterBar? If you take a look at the unit test, the following expression returns the filterText as the first arg. I just doubled checked and verified that its returning.

expression: function (filterText, value, index, array) {
    return value.name.length >= 8 || value.description.indexOf(filterText) !== -1;
}

from ionic-filter-bar.

vcalvello avatar vcalvello commented on August 23, 2024
vm.filterBarInstance = $ionicFilterBar.show({
    items: vm.gamesData,
    expression: function (filterText, value, index, array) {
        console.log(arguments.length);
        console.log(arguments);
        console.log(filterText);
        return true;
        //return value.game.name.indexOf(filterText) !== -1;
    },
    update: function (filteredItems, filterText) {
       vm.gamesData = filteredItems;
    }
});

and the console output

3
[Object, 1, Array[5]]
Object {game: Object, extra: Object, $$hashKey: "object:52"}

from ionic-filter-bar.

djett41 avatar djett41 commented on August 23, 2024

@vcalvello I am not able to see what your seeing.. when I add the exact same expression to the demo app in this repo, I get the following log for arguments when searching for "my search"

["my search", Object, 1998, Array[1999]]

Are you on the latest version? Pull down the demo, verify that you see what I'm seeing, then either try to see what the difference between your version and the demo version, or see if you can put a codepen together so I can look at it. Thanks!

from ionic-filter-bar.

vcalvello avatar vcalvello commented on August 23, 2024

@djett41 Seems to be something with the published component version. Everything fine using the repo src

from ionic-filter-bar.

djett41 avatar djett41 commented on August 23, 2024

@vcalvello Which version are you on? I tried both the unminified and minified dist but am seeing the correct behavior. Perhaps there was an issue with a previous version? Can you verify you're on the latest version? If you are still seeing the issue, If you can put together a codepen that I can replicate the issue I can look into it thanks!!

from ionic-filter-bar.

yang-zhang-syd avatar yang-zhang-syd commented on August 23, 2024

I can confirm this problem. The code in source is difference from latest release and using the source code everything works fine.

from ionic-filter-bar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.