From b69aa1ed25227311ae50e59f6310457b02f053ce Mon Sep 17 00:00:00 2001 From: KoshaevEugeny <103786108+akulistus@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:45:11 +0300 Subject: [PATCH] fix(inline-tool-link): use defaultValue to prevent selectionchange event (#2993) * fix(inline-tool-link): use defaultValue to prevent selectionchange event * fix(link-tool): handle formatted linked text clicks * fix test errors * Revert "fix test errors" This reverts commit 582e137b77a159aa7d9d6c6459e9694d426463ad. * Revert "fix(link-tool): handle formatted linked text clicks" This reverts commit ae90e03c602725259f262570746495c1eaa8107f. --- docs/CHANGELOG.md | 4 ++++ package.json | 2 +- src/components/inline-tools/inline-tool-link.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 75194262..ce1e6997 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 2.31.4 + +- `Fix` - Prevent inline-toolbar re-renders when linked text is selected + ### 2.31.3 - `Fix` - Prevent text formatting removal when applying link diff --git a/package.json b/package.json index e17e6f2a..49b61542 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/editorjs", - "version": "2.31.3", + "version": "2.31.4", "description": "Editor.js — open source block-style WYSIWYG editor with JSON output", "main": "dist/editorjs.umd.js", "module": "dist/editorjs.mjs", diff --git a/src/components/inline-tools/inline-tool-link.ts b/src/components/inline-tools/inline-tool-link.ts index 999a30c4..0bef25c7 100644 --- a/src/components/inline-tools/inline-tool-link.ts +++ b/src/components/inline-tools/inline-tool-link.ts @@ -212,7 +212,7 @@ export default class LinkInlineTool implements InlineTool { */ const hrefAttr = anchorTag.getAttribute('href'); - this.nodes.input.value = hrefAttr !== 'null' ? hrefAttr : ''; + this.nodes.input.defaultValue = hrefAttr !== 'null' ? hrefAttr : ''; this.selection.save(); } else {