New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update highlightFirstItem to take tags in to consideration #5812
Conversation
I've been thinking about this one for the last 9 days and I think the solution I'm aiming to go for is instead of modifying |
No problem, sounds like a neater way of doing it 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Reopening as a reminder about the decorator plan since I don't see an attached ticket. |
…that option first
This switches the implementation to use a decorator which is only added when the `tags` option is set during initialization. Functionally it has no change on the effect but it allows for the logic to be more isolated. In the end it just keeps it more organized and works towards cutting back on what is included in the core results. This also changes the call for setting the `select2-data-tag` attribute to properly set the attribute as a string instead of relying on the boolean to string conversion.
…t2#5812) * refactor: check for unselected options when using tags and highlight that option first * Switch to using a decorator for highlighting tags This switches the implementation to use a decorator which is only added when the `tags` option is set during initialization. Functionally it has no change on the effect but it allows for the logic to be more isolated. In the end it just keeps it more organized and works towards cutting back on what is included in the core results. This also changes the call for setting the `select2-data-tag` attribute to properly set the attribute as a string instead of relying on the boolean to string conversion. * Fix tabbing in newly added decorator * Add tests for tag focusing in results Co-authored-by: Kevin Brown <kevin@kevin-brown.com>
This pull request includes a
The following changes were made:
Results.prototype.highlightFirstItem
to check for unselected options and if thetags
option is set. If so, highlight this first instead of a previously selected option.This works at the moment when no tags exist, but not when there are existing selected tags.
Fix
Current