Skip to content

Conversation

@bbenjamin
Copy link
Collaborator

Upon further review the work in #8 needed to be elaborated upon.

The listbox role is what allows the button lists to be identified as active elements within the form. A Listbox requires the immediate children to be focusable, and those must have no focusable children of their own. Fortunately it was relatively easy to change the <a> "buttons" to <span> and move the keyboard and focus handlers to the <li>. It's a big refactor so there may be a missing use case in there...

@bbenjamin bbenjamin requested a review from zrpnr May 27, 2021 18:29
href=""
:id="buttonId"
:data-expanded="isExpanded"
v-on:click.prevent="selectButton"
Copy link
Owner

@zrpnr zrpnr May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for a click action anymore, even on the <li> ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not then the selectButton method can be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some manual testing and it still needs the click action so I brought it to the li

const itemSelector = `ckeditor5-toolbar-item ckeditor5-toolbar-item-${props.id}`;
const buttonSelector = `ckeditor5-toolbar-button ckeditor5-toolbar-button-${props.id}`;
const buttonId = `${props.id}-button-${Math.random().toString(36).substring(7)}`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just added this buttonId, in the last PR, there's no more use for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more use for it. The previous issue addressed a duplicate ID problem. In this issue, the refactoring included changing focus behavior so IDs aren't needed, which was the only thing the IDs were needed for.

Copy link
Owner

@zrpnr zrpnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the focus on the active button when moving between lists between the keyboards is much better now, switching back to main and it seems obviously broken. Now it's possible to really quickly move items between available and active, and stay on the same item the entire time. Nice work!

@zrpnr zrpnr merged commit 0b2f8b0 into main May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants