Coder Social home page Coder Social logo

hillelcoren / flex-autocomplete Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 24.0 426 KB

Advanced Flex AutoComplete component which supports browsing, selecting and ordering multiple items.

Home Page: http://hillelcoren.com/flex-autocomplete/

License: MIT License

CSS 41.85% ActionScript 58.15%

flex-autocomplete's People

Contributors

dretch avatar hillelcoren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flex-autocomplete's Issues

The AutoComplete component overwrites its dataProvider's filterFunction

(This was originally logged at https://code.google.com/p/flex-autocomplete/issues/detail?id=10)

What steps will reproduce the problem?

  • Create an AutoComplete component with a dataProvider that has a filterFunction that removes some of the items from the ListCollectionView, e.g. roughly:
var dp = new ListCollectionView(...);
dp.filterFunction = someFilterFunction;
someAutoComplete.dataProvider = dp;
  • Then type something in the displayed AutoComplete box.

What is the expected output? What do you see instead?

I expected that the AutoComplete's drop-down list contained items that matched the filterFunction that was initially set on the dataProvider and also matched the search text. Instead, the drop-down displayed all items that matched the search text, regardless of whether they matched the original filterFunction.

What version of the product are you using? On what operating system?

flex-autocomplete 1.2-fx4 on Mac OS X

Please provide any additional information below.

This happens because the AutoComplete component overwrites the filterFunction of its dataProvider with its own function.

A fix would be to change the AutoComplete component to wrap the dataProvider that it is given in another ListCollectionView and to set the filterFunction on the wrapper. The issue can also be worked around without modifying the AutoComplete component by passing an already-wrapped ListCollectionView to the AutoComplete.

Note: It is possible that this is intended behavior. But I found it surprising so I think it is might be a genuine bug. If you are happy that this is a bug then I can send a pull request to fix it.

Search text is treated as a regular expression in the AutoComplete component

This appears to be caused by the implementation of this method: https://github.com/hillelcoren/flex-autocomplete/blob/master/fx3src/com/hillelcoren/utils/StringUtils.as#L25

I assume this is not the intended behaviour because I can't find any documentation saying it is.

I might submit a pull request to fix this issue. Should the change be made in both the fx3src and fx4src StringUtils files? I would be tempted to only change the fx4 version because that is the version I am using in my project and so it is the only version I can easily test.

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.