Bugs fixed
---------
[!] Fixed issue when open popup windows was not automatically closed when MouseEvent.MOUSE_WHEEL occurred somewhere outside of the component;
[!] Fixed issue "Error when hit Enter in InputAssist with no dataProvider" https://github.com/JabbyPanda/InputAssist/issues/2.
And the last, but not the least - InputAssist is now ready to be used in projects compiled against Flex 4.5 SDK - I just did some code trick due to the public API change in MatrixUtil.getConcatenatedMatrix method in Flex 4.5.
As always, the most recent source code of the component and compiled SWC library file is available at github.com/JabbyPanda/InputAssist
The 0.13 version does not contain a lot of new exciting features, the main focus of this version was to fix a couple of not so crucial bugs and to make sure that we will not have possible memory leaks when adding/removing InputAssist component to the DisplayList.
The only "new" feature is that InputAssist now supports dataProvider typed as ArrayList.
Here is the full changelist for this release:
[!] Fixed issue with resetting visible "prompt" value when changing dataProvider
[!] Fixed issue by keyboard navigation by the help of Keyboard.UP and Keyboard.DOWN buttons
within option list if option list was closed and reopened.
[!] Items that had "-" or "+" symbols in its labels were not properly filtered
[!] Creating complete copy of passed ArrayCollection into dataProvider to avoid filtering of the original data source
[!] Fixed RTE when using InputAssist control within Adobe AIR app in "onFlexWindowActivate" event listener
[!] Started to use weak references when adding event listeners to avoid possible memory leaks
[!] "dataProvider" property now accepts data list typed as ArrayList.
As always, the most recent source code of the component and compiled SWC library file is available at GitHub
"processing" property
Quite often the long data list is being loaded into InputAssist control asynchronously from remote destinations. Now InputAssist is able to display "hourGlass" icon during the data loading process by controlling "processing" property.
"errorMessage" property
If InputAssist's dataProvider is currently empty, then there is nothing to be chosen from. Displaying "errorMessage" text and disabling the control gives the user the right UI feedback about the component state.
"prompt" property
If no value is not selected yet via InputAssist control, the control can display text specified by the "prompt" value to explain what action is expected to be taken from the user side.
Alternative usage of "prompt" property that I can think of - is to display the suppossedly selected current data object label which is not present in the InputAssist's dataProvider list == e.g. this selected data object is not valid and should be altered by the further user action.
And yes, sorry about long time delay to retrieve city list in the demo below, it is not a component fault, but long service time response from api.business.gov
[+] Added style "highlightBackgroundColor" to InputAssist
[+] Added Ant build script
[+] Packaged as SWC library
[*] Changed classes namespace to match industry standard
[*] Changed the algorithm for the highlighting of matched text segments, thankfully to Maxim Kachurovsky "Slov v sapogah" for an idea
[!] Fixed the appearance of popup list when "forceAuto" option is on and
system focus is moved back and forth between 2 different instances of FocusManager class.
And the last, but not least, the Flex 4 AutoComplete component written by Tenger Ivan.
While "AutoComplete" is a very strong brand and it is well known to the end users, I'd like to bring into Flex components naming world more creativity.
What if I will rename AutoComplete control to InputAssist? You see, my component not only "auto-completes", it is also providing an helping hand to faster select the value in need from the list of options.
So, in general, what do you think of InputAssist name?
Updated: More recent version of this component was announced at September.
Disclaimer: My implementation of AutoComplete component is based on the revised codebase of AutoComplete 4 component originally created by Tenger Ivan from FlashCommander.org
Two different search modes are supported : PREFIX and INFIX, to see the difference please play with the interactive sample file below.
The auto-completion operation can be achieved in two ways:
via keyboard
First, select the list item by moving selected index via UP and DOWN keys and confirm the choice by hitting ENTER key
via mouse
Just mouse click upon the currently selected list item.
Disclaimer: the source code of this component is of beta quality and can be obtained for free here: ZIP file, 23 kb. If any bug is found, please let me know.
UPD: Updated sample file with a real world list of 978 US universities.
Also a few bugs were fixed related to case insensitive search and not working text highlight of the last string character.