Skip to content

Fix incorrect selection handling in the Rich Combos#5478

Merged
KarolDawidziuk merged 5 commits intomasterfrom
t/5437
Jun 19, 2023
Merged

Fix incorrect selection handling in the Rich Combos#5478
KarolDawidziuk merged 5 commits intomasterfrom
t/5437

Conversation

@Comandeer
Copy link
Copy Markdown
Member

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

  • Unit tests
  • Manual tests

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.

  • PR is consistent with the code style guide

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
Copy link
Copy Markdown

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.

@github-actions github-actions bot added the stale The issue / PR will be closed within the next 7 days of inactivity. label May 27, 2023
@KarolDawidziuk KarolDawidziuk removed the stale The issue / PR will be closed within the next 7 days of inactivity. label May 29, 2023
@KarolDawidziuk KarolDawidziuk self-assigned this Jun 1, 2023
@Comandeer
Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Contributor

@KarolDawidziuk KarolDawidziuk left a comment

Choose a reason for hiding this comment

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

Hi @Comandeer

Good job on removing the unnecessary method, therefore, improving selection handling in the Rich Combos. 👏

There is one place that we must update as this method no longer exist.
https://github.com/ckeditor/ckeditor4/blob/master/plugins/floatpanel/plugin.js#L427-L430

This shortened if statement is no longer valid and we can simplify it to just:

if ( CKEDITOR.env.ie ) {
	CKEDITOR.tools.setTimeout( function() {
		block._.markFirstDisplayed();
	}, 0 );
} else {
	block._.markFirstDisplayed();
}

Could you update it, please?

@KarolDawidziuk KarolDawidziuk removed their assignment Jun 2, 2023
@github-actions
Copy link
Copy Markdown

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.

@github-actions github-actions bot added the stale The issue / PR will be closed within the next 7 days of inactivity. label Jun 16, 2023
@KarolDawidziuk KarolDawidziuk removed the stale The issue / PR will be closed within the next 7 days of inactivity. label Jun 16, 2023
@Comandeer
Copy link
Copy Markdown
Member Author

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.

@Comandeer Comandeer requested a review from KarolDawidziuk June 19, 2023 11:25
Copy link
Copy Markdown
Contributor

@KarolDawidziuk KarolDawidziuk left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@KarolDawidziuk KarolDawidziuk merged commit 6445221 into master Jun 19, 2023
@KarolDawidziuk KarolDawidziuk deleted the t/5437 branch June 19, 2023 21:49
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.

Add indication of the selected item in the combobox

2 participants