Releases: UrbanCompass/ngc-omnibox
Update Dependencies + `multiple` behavior
Add support for disabling scrollIntoView
- Add support for disabling scrollIntoView (#85)
Update babel configuration
- Update babel config (#82)
Add hideOnChosen option
Ignore input change events that happen when the field is blurred
This was leading to a situation where the suggestions would show if you changed the query from outside the omnibox, since onInputChange
fires when the query changes.
Call updateSuggestions w/o query on input change
As long as canShowSuggestions()
is still cool with it.
This removes the assumption that the implementor doesn't want to do something with the suggestions even when there's no query. They might want to show something like instructions or helper UI, or even some pre-generated default suggestions. This is now all possible.
Fix focus bug when clicking on a token
Previously, the highlighted choice was getting cleared when a token was blurred, which was a silly thing to do since we blur the token and focus the component so we can better handle keyboard events. This would cause clicking on a token to highlight and then instantly unhighlight it.
Additionally, now when you start typing like normal while a token is highlighted, we focus the field, unhighlight the token, and input the text into the field so the user doesn't have to bother unhighlighting when typing.
Add reference to omnibox into locals of all &-callback functions
Add reference to omnibox into locals of all &-callback functions (#64) Makes it consistent. Some things had access and others didn't, it's just easier if everything has this reference now.
Fix bugs with choose/unchoose
- If the default was prevented, then performed, we were no longer
checking to make sure it wasn't already added to the list of choices.
This meant that if the implementor added it themselves it would be
then added twice - The UI behavior performed once a choice was added was being
grouped into the performDefault function, meaning if the implementor
wanted to update the model themselves and prevented default, the UI
would be out of sync. I've pulled that out of the performDefault
function and now always do it since it has nothing to do with the data
model
Add ability to prevent or delay updating the ngModel on choose/unchoose
onChosen
and onUnchosen
now get access to an $event
object in their locals which let them
call preventDefault()
to prevent updating of the model, and later performDefault()
to perform it.
Also, added unit tests for the choose
and unchoose
functions, including these new features.