Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The whole inline-toolbar recreates itself endlessly when opening link-toolbar #2821

Open
tmclagen opened this issue Sep 1, 2024 · 1 comment
Labels

Comments

@tmclagen
Copy link

tmclagen commented Sep 1, 2024

It's a very strange bug which becomes quite obvious and visible if you add a bit of transitions to the .ce-toolbar__content. For some reason if you open link-submenu the whole inline-toolbar gets recreated and repopulated endlessly until you click on an input element (make it focused). It doesn't happen on link creation because then the input gets focused initially, but when you try to edit a link, that's when the input doesn't get focused and the whole bug begins. At least, that's what I presumed at first but then I discovered that you can click anywhere inside the inline toolbar (not only input) and the vigorous recreation stops.

Steps to reproduce:

  1. Type some text
  2. Select some parts of it and turn it into a link
  3. Close the inline toolbar
  4. Double click on the created link to open the inline toolbar

Expected behavior:

  1. The inline toolbar elements should be created only once (at the init of editorjs or when you open the inline toolbar)
  2. It should work properly with transitions and animations to allow for open and close animations

You can see the bug in action here:
https://github.com/user-attachments/assets/9c773f95-1f0f-4285-ad38-3c4a93dd8d3b

OS: Window 11
Browser: Google Chrome 128.0.6613.114
Editor.js version: 2.30.5

@tmclagen tmclagen added the bug label Sep 1, 2024
@RobinDev
Copy link

RobinDev commented Sep 9, 2024

I patch this bug a dirty way by focusing the link input during renderActions :

setTimeout(() => this.nodes.input.focus(), 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants