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

Pressing the tab key in restricted editing mode enters a table thats non editable #16070

Conversation

illia-stv
Copy link
Contributor

Suggested merge commit message (convention)

Fix (widget): Pressing tab should not focus widget editable. Closes #15506.


Additional information

For example – encountered issues, assumptions you had to make, other affected tickets, etc.

@illia-stv illia-stv self-assigned this Mar 21, 2024
@arkflpc arkflpc requested review from niegowski and arkflpc and removed request for niegowski March 25, 2024 09:02
@@ -287,6 +287,7 @@ export function toWidgetEditable(
writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );

writer.setAttribute( 'role', 'textbox', editable );
writer.setAttribute( 'tabindex', '-1', editable );
Copy link
Contributor

Choose a reason for hiding this comment

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

How would it behave if the whole editor has other tabindex set by integrators? For instance tablindex=-2. Was it tested (in manual test or otherwise)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, it would behave the same

Copy link
Contributor

Choose a reason for hiding this comment

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

From MDN:

A negative value (the exact negative value doesn't actually matter, usually tabindex="-1") means that the element is not reachable via sequential keyboard navigation.
Note: tabindex="-1" may be useful for elements that should not be navigated to directly using the Tab key, but need to have keyboard focus set to them. Examples include an off-screen modal window that should be focused when it comes into view, or a form submission error message that should be immediately focused when an errant form is submitted.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex

@illia-stv illia-stv requested a review from arkflpc March 25, 2024 15:17
@niegowski niegowski merged commit e55c6c1 into master Apr 2, 2024
1 of 6 checks passed
@niegowski niegowski deleted the ck/15506-pressing-the-tab-key-in-restricted-editing-mode-enters-a-table-thats-non-editable branch April 2, 2024 15:53
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.

Pressing the Tab key in restricted editing mode enters a table that's non-editable
3 participants