From eee7f8f145efbd1fadc063b49c650b013a5f235c Mon Sep 17 00:00:00 2001 From: Jeff Galbraith Date: Mon, 30 Nov 2020 17:25:01 -0700 Subject: [PATCH] fix(editor): Icons are activating/deactivating synchronously when having multiple QEditors with :toolbar props (#8044) (#8127) --- ui/src/components/editor/editor-caret.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/components/editor/editor-caret.js b/ui/src/components/editor/editor-caret.js index b00b5c50172..c2469854828 100644 --- a/ui/src/components/editor/editor-caret.js +++ b/ui/src/components/editor/editor-caret.js @@ -228,8 +228,11 @@ export class Caret { case void 0: return false default: - const state = document.queryCommandState(cmd) - return param !== void 0 ? state === param : state + if (this.hasSelection) { + const state = document.queryCommandState(cmd) + return param !== void 0 ? state === param : state + } + return false } }