Releases: MuseofMoose/SearchSelect
Support for Required Angular 1.6 Lifecycle Hooks
Angular 1.6 now demands the use of its $onInit lifecycle hook in order to properly initialize directives. This release updates the code base to satisfy this requirement.
Changes:
- Adding $onInit lifecycle hook to properly initialize directive for Angular 1.6
Bug Fixes and Validation Improvements
A handful of small changes. See the change log for details.
Changes:
- Defaulting to the first option in the search list when using the keyboard.
- This makes navigating the options via keyboard a little more sensible.
- Improved validation and error handling.
- Made a few refactoring changes to reduce inefficiency.
- Bug fixes.
CSS Class for Matched Search Substring
Updated the search function to break down the display name of search results and add a CSS class to the matched substring. See the changelog below for details.
Changes:
- Search substring styling added.
- Now, when you start typing into the input to filter your search results, the matched substring on each option is wrapped in a span tag with a unique class.
- The default styling is simply a greater font-weight (bold) but you can customize the class to suit your preference.
Disabled/Required Support
Added two new optional params in order to support disabling and requiring the search select. See the changelog below for details.
Changes:
- "Disabled" support added.
- There is a new optional param that allows you to specify a boolean expression to represent the disabled state of the search select.
- A disabled search select cannot be interacted with and will have an opacity of .5 to distinguish it from an active search select (works the same as ng-disabled). Depending on your browser, additional styling may be automatically applied.
- "Required" support added.
- There is a new optional param that allows you to specify a boolean expression to represent the required state of the search select (works the same as ng-required).
- When used in a form, a required search select will render the form invalid if a value has not been selected. A search select that has a required value of false will not affect the validity of the form, regardless of the selection that has been made.
Keyboard Support/Usability Improvements
Keyboard support and several usability improvements have been added. See the changelog below for details.
Changes:
- Keyboard Support added.
- Once the search select is active, you can now navigate through the options using the arrow keys.
- You can also use the escape key to close the search select and the enter key to select an option.
- Improved optionLabelKeys parsing.
- Previously, optionLabelKeys which shared substrings with other object attributes would cause problems. This has been resolved.
- Instead of requiring an "id" attribute on options, a custom attribute to ID by can be specified.
- Previously, I was requiring an "id" attribute on every object in the option list in order to properly id them when making selections from a filtered list and when populating an already-selected option. Now, you can specify which attribute on the option objects to use for ID-ing.
- Changed names of index and display_name attributes so they are less likely to conflict with existing attributes on passed in objects.
- In order to prevent accidentally overwriting options which are already using an "index" or "display_name" attribute, I changed the internal attributes to "ss_index" and "ss_display_name" as the are significantly less likely to cause conflicts.
- Pulled the plug on Legacy Support.
- I'm a one man team. As much as I wanted to practice supporting multiple versions, I'd much rather spend that time working on other projects. Going forward, this directive will only work with Angular 1.3 and up. Please understand.
First official release
The first, fully-functional (if somewhat basic) version of the search select app.
Supports selection of a single object from a list of objects in addition to searching by a specified attribute of each object (that attribute has to be used as the display name, for now).