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 582e137b77.

* Revert "fix(link-tool): handle formatted linked text clicks"

This reverts commit ae90e03c60.
This commit is contained in:
KoshaevEugeny 2026-03-04 23:45:11 +03:00 committed by GitHub
commit b69aa1ed25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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",

View file

@ -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 {