Skip to content

Commit 8fbd11b

Browse files
authored
fix: hide opening tooltip on color or background button click (#10032)
1 parent 573c5d2 commit 8fbd11b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ export const RichTextEditorMixin = (superClass) =>
662662

663663
/** @private */
664664
__onColorClick() {
665+
this._tooltip.opened = false;
665666
this._colorEditing = true;
666667
}
667668

@@ -678,6 +679,7 @@ export const RichTextEditorMixin = (superClass) =>
678679

679680
/** @private */
680681
__onBackgroundClick() {
682+
this._tooltip.opened = false;
681683
this._backgroundEditing = true;
682684
}
683685

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,5 +677,23 @@ describe('toolbar controls', () => {
677677

678678
expect(undo.hasAttribute('aria-describedby')).to.be.false;
679679
});
680+
681+
it('should hide tooltip on color button click after mouseenter', async () => {
682+
const color = getButton('color');
683+
fire(color, 'mouseenter');
684+
color.click();
685+
686+
await nextRender();
687+
expect(overlay.opened).to.be.false;
688+
});
689+
690+
it('should hide tooltip on background button click after mouseenter', async () => {
691+
const background = getButton('background');
692+
fire(background, 'mouseenter');
693+
background.click();
694+
695+
await nextRender();
696+
expect(overlay.opened).to.be.false;
697+
});
680698
});
681699
});

0 commit comments

Comments
 (0)