ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.78k stars 2.46k forks source link

Fix incorrect selection handling in the Rich Combos #5478

Closed Comandeer closed 1 year ago

Comandeer commented 1 year ago

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches that change the editor code must include tests. You can always read more on PR testing, how to set the testing environment and how to create tests in the official CKEditor documentation.

This PR contains

Did you follow the CKEditor 4 code style guide?

Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.

What is the proposed changelog entry for this pull request?

* [#5437](https://github.com/ckeditor/ckeditor4/issues/5437): Fix: incorrect indication of selected items in comboboxes.

What changes did you make?

I've discovered that we have a whole logic to apply the [aria-selected] attribute in place. However, the selected item was unmarked upon each opening of the combobox due to an incorrectly applied fix to an old accessibility issue. It was supposed to ensure that after opening the context menu, the first item will be focused. However, as comboboxes are not context menus and their keyboard interaction pattern is quite different, I simply removed the old fix.

As a bonus, we now have also correct styling of the selected items in comboboxes 🎉

Which issues does your PR resolve?

Closes #5437.

github-actions[bot] commented 1 year ago

It's been a while since we last heard from you. We are marking this pull request as stale due to inactivity. Please provide the requested feedback or the pull request will be closed after next 7 days.

Comandeer commented 1 year ago

As the "Styles" combo seems to work well even without the fix, I've updated tests to use the "Font" one. Additionally I've rebased the PR onto the latest master.

github-actions[bot] commented 1 year ago

It's been a while since we last heard from you. We are marking this pull request as stale due to inactivity. Please provide the requested feedback or the pull request will be closed after next 7 days.

Comandeer commented 1 year ago

After F2F with @KarolDawidziuk we decided to keep the conditional in the same shape to ensure the highest backward compatibility with potential custom marking logic for panels.