-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Use standard dropdowns for combobox #9462
Conversation
Co-authored-by: Zbynek Konecny <zbynek1729@gmail.com>
if (!selectedItem) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
occurs when navigating between potential text left and right without selecting an item (doesn't cause an issue just stacktraces in the console)
e.g. type North, then navigate left on the keyboard
Looks like quite a bit of code was copied from #9453, some parts were improved here (e.g. I missed the |
I don't mind either way, I've just noticed that the Dynamic combobox example is broken though so will convert this back to draft and take another look later |
Please take a moment and address the merge conflicts of your pull request. Thanks! |
Retested all with the examples on http://localhost:8080/jenkins/design-library/Inputs/ I've refactored out some common code as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@janfaracik you able to check this please? |
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
Fixes jenkinsci/design-library-plugin#13
Unfortunately can't delete https://github.com/jenkinsci/jenkins/blob/master/war/src/main/webapp/scripts/combobox.js as
editableComboBox
still uses it, #9461 removes the last usage in core though.This improves the usability and accessibility of the control by adding styling when doing keyboard navigation, and makes the code a lot simpler and easier to follow (last one used very old JavaScript design patterns and was hard to understand)
I haven't added support for
allowMultipleValues
as I couldn't find any usages of it.Testing done
Tested with the design library example http://localhost:8080/jenkins/design-library/Inputs/
Keyboard navigation, tab and enter on item
Clicking the item
Tabbing away before selecting an item
Editing items and making sure they show up
Unlike autocomplete, combobox shows items immediately so tested some special handling for that
I've also tested with #9461 (which was motivated by this PR)
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist