Skip to content

Commit b69aa1e

Browse files
authored
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 582e137. * Revert "fix(link-tool): handle formatted linked text clicks" This reverts commit ae90e03.
1 parent a89f3d0 commit b69aa1e

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 2.31.4
4+
5+
- `Fix` - Prevent inline-toolbar re-renders when linked text is selected
6+
37
### 2.31.3
48

59
- `Fix` - Prevent text formatting removal when applying link

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/editorjs",
3-
"version": "2.31.3",
3+
"version": "2.31.4",
44
"description": "Editor.js — open source block-style WYSIWYG editor with JSON output",
55
"main": "dist/editorjs.umd.js",
66
"module": "dist/editorjs.mjs",

src/components/inline-tools/inline-tool-link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export default class LinkInlineTool implements InlineTool {
212212
*/
213213
const hrefAttr = anchorTag.getAttribute('href');
214214

215-
this.nodes.input.value = hrefAttr !== 'null' ? hrefAttr : '';
215+
this.nodes.input.defaultValue = hrefAttr !== 'null' ? hrefAttr : '';
216216

217217
this.selection.save();
218218
} else {

0 commit comments

Comments
 (0)