Skip to content

Commit 2b2065d

Browse files
fix: focus first color button when opening color popups (#10901) (#10905)
Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
1 parent 9d4e00e commit 2b2065d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/rich-text-editor/src/vaadin-rich-text-editor-popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class RichTextEditorPopup extends PolylitMixin(LitElement) {
3535
:host([opened]),
3636
:host([opening]),
3737
:host([closing]) {
38-
display: contents !important;
38+
display: block !important;
3939
position: fixed;
4040
}
4141

packages/rich-text-editor/test/toolbar.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ describe('toolbar controls', () => {
241241
overlay = popup.shadowRoot.querySelector('vaadin-rich-text-editor-popup-overlay');
242242
});
243243

244+
it(`should focus first color button in ${style} popup when opened`, async () => {
245+
getButton(style).click();
246+
await oneEvent(overlay, 'vaadin-overlay-open');
247+
248+
const firstButton = popup.querySelector('button');
249+
expect(document.activeElement).to.equal(firstButton);
250+
});
251+
244252
it(`should apply ${style} when clicking the "toolbar-button-${style}" and selecting value`, async () => {
245253
getButton(style).click();
246254
await oneEvent(overlay, 'vaadin-overlay-open');

0 commit comments

Comments
 (0)