Skip to content
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-22496: Link dialog option button is not keyboard operable #3714

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,22 @@
return {
id: 'optionsToggle',
type: 'html',
html: '<div class="linkOptionsToggle">' +
html: '<button class="linkOptionsToggle" type="button">' +
'<label class="cke_dialog_ui_labeled_label">' +
'<span class="arrow arrow-right"></span> ' +
CKEDITOR.tools.htmlEncode(editor.localization.get('xwiki-link.options')) +
'</label>' +
'</div>',
'</button>',
onLoad: function() {
// Since we do not (and cannot without deeper changes) use the 'button' type,
// we need to add this element explicitely to the Dialog focus list.
// We need to hardcode the position since we do not have access to the setupFocus function to reorder the list
// relative to native tab order.
// The four elements before this button are: display link, page selection *3
this.getDialog().addFocusable(this.getElement() , 4);
// Without this, the keyboard press on this focusable element will trigger the click twice...
this.getElement().removeAllListeners();
mflorea marked this conversation as resolved.
Show resolved Hide resolved
// We use the CKEDITOR.dom.element event utilities. This `on` is not related to JQuery.
this.getElement().on('click', this.toggleLinkOptions, this);
},
toggleLinkOptions: function(event) {
Expand Down
Loading