-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
XWIKI-22339: Icon picker is not keyboard operable #3800
Conversation
* Updated the type of the icon buttons to be actual buttons and not disguised divs. * Added word break indicators in the icon names, for cleaner breaks on long iconNames. * Moved the DOM representation of the picker right after the input. * Added an escape listener on the picker content to easily get out of it. * Updated style to avoid having too big of a change with the new DOM. * Improved style for long iconNames, which were poorly supported before.
* Escaped changes
* Fixed typo
@@ -243,14 +243,21 @@ require(['jquery', 'xwiki-icon-picker'], function($) { | |||
for (var i=0; i < iconTheme.length; ++i) { | |||
// Display the icon | |||
if (selectedIconName === '' || iconTheme[i].name.includes(selectedIconName)) { | |||
var displayer = $(document.createElement('div')); | |||
var displayer = $(document.createElement('button')); |
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.
any reason to not use $('<button>')
(see https://api.jquery.com/jQuery/#jQuery2)?
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.
Not really, just keeping the changes minimal. AFAICS all the elements created in this file use this pattern. I figured keeping this pattern is the safest choice (though I doubt it would change anything in any situation).
Should I replace all the instantiations with the pattern you proposed?
No changes applied yet.
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.
Should I replace all the instantiations with the pattern you proposed?
Probably not, leave it like this.
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.
LGTM except the minor comment I made on code style.
* XWIKI-22339: Icon picker is not keyboard operable * Updated the type of the icon buttons to be actual buttons and not disguised divs. * Added word break indicators in the icon names, for cleaner breaks on long iconNames. * Moved the DOM representation of the picker right after the input. * Added an escape listener on the picker content to easily get out of it. * Updated style to avoid having too big of a change with the new DOM. * Improved style for long iconNames, which were poorly supported before. * Escaped changes * Fixed typo (cherry picked from commit 818bc25)
Jira URL
https://jira.xwiki.org/browse/XWIKI-22339
Changes
Description
Screenshots & Video
Video demo of the iconpicker with the changes proposed in this PR:
2025-01-14.18-03-08.mp4
Executed Tests
Successfully passed
mvn clean install -f xwiki-platform-core/xwiki-platform-icon/ -Pquality,integration-tests,docker
. Ranmvn xar:format
to make sure every addition was XML escaped.Expected merging strategy