editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Inline link tool interaction with other inline tools is broken

Open pawelbajgrowicz opened this issue 1 year ago • 4 comments

First Issue

Steps to reproduce:

  1. Write text
  2. Add inline tag (ie. b) for this text
  3. Add link for this text

Expected behavior:

  • Link tag should not destroy actual inline tags.
  • Link should be added inside

Recording: 2024-12-16 13-06-47

Second Issue

Steps to reproduce:

  1. Write text
  2. Add link tag for this text
  3. Add inline tag for some part of the link

Expected behavior:

  • Tag should be added only in part of the link (now it destroys every inline tags in text)

Recording: 2024-12-16 13-06-47

Setup

Device, Browser, OS: Chromium 131

Editor.js version: From the website and also ocurr locally on 2.30.6

Plugins you use with their versions: Link doesnt work with built in inline and everyting from https://github.com/natterstefan/editorjs-inline-tool/tree/master

pawelbajgrowicz avatar Dec 16 '24 12:12 pawelbajgrowicz

Yes we're also experiencing this issue. It was working in v2.29.1, so from what I can tell it's been broken since the very next release which was v2.30.0.

AlexGaillard avatar Mar 05 '25 19:03 AlexGaillard

This appears to be related to the introduction of nested popover support in v2.30. The Link inline tool is now treated as a nestedPopoverTriggerItem, likely because it includes its own input field for entering a URL: https://github.com/codex-team/editor.js/blob/next/src/components/utils/popover/popover-inline.ts#L172

Because of this, when a user switches to another inline tool (e.g., bold or italic), the handleItemClick logic seems to trigger the Links inline button click (toggle) event again. This results in the anchor tag being removed unexpectedly: https://github.com/codex-team/editor.js/blob/next/src/components/inline-tools/inline-tool-link.ts#L176

@TatianaFomina Would you be able to provide any insight into this behavior?

LegendMike-Pollard avatar Jul 02 '25 20:07 LegendMike-Pollard

@LegendMike-Pollard I'm also experiencing this issue with editorjs 2.29. I'm not even able to set a whole link italic/bold.

anghenfil avatar Sep 17 '25 20:09 anghenfil

I can confirm the issue.

neSpecc avatar Sep 17 '25 20:09 neSpecc