From 45a6f4f188687352b1720bbf4668e4a68438769d Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Fri, 30 May 2025 16:54:40 +0200 Subject: [PATCH] fix: state of bold formatting in inline toolbar --- docs/CHANGELOG.md | 1 + src/components/inline-tools/inline-tool-bold.ts | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5770a1e74..0d4914e76 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -16,6 +16,7 @@ - `DX` - Tools submodules removed from the repository - `Improvement` - Shift + Down/Up will allow to select next/previous line instead of Inline Toolbar flipping - `Improvement` - The API `caret.setToBlock()` offset now works across the entire block content, not just the first or last node. +- `Fix` - Showing the correct state of bold formatting in the inline toolbar ### 2.30.7 diff --git a/src/components/inline-tools/inline-tool-bold.ts b/src/components/inline-tools/inline-tool-bold.ts index c3a4d9d2b..08e905b90 100644 --- a/src/components/inline-tools/inline-tool-bold.ts +++ b/src/components/inline-tools/inline-tool-bold.ts @@ -46,9 +46,8 @@ export default class BoldInlineTool implements InlineTool { return { icon: IconBold, name: 'bold', - onActivate: () => { - document.execCommand(this.commandName); - }, + toggle: true, + onActivate: () => document.execCommand(this.commandName), isActive: () => document.queryCommandState(this.commandName), }; }