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

Add a check that allows inline toolboxes to work with nested editorsjs

Open loucass003 opened this issue 1 year ago • 15 comments

In our project, we have cases where we can have nested editorjs. For instance, we have a block tool that will create an editorjs instance inside of it.

We ran into a situation where the inline toolbox would close when opening the link tool inside a nested editor. This is due to the editor checking for the parent block only to verify if we clicked outside the toolbox.

We added a check that should prevent this issue (at least it does for us) and also keep the standard functionality of editorjs. We hope that this change can be merged so we can get rid of our fork and make everyone else benefit from it.

Respectfully, Lucas Lelievre

loucass003 avatar Jan 04 '24 17:01 loucass003

Hello @loucass003, i also have nested EditorJs and also have the same problem. But i have and another broblem with nested Editor js, maybe did u meet the same problem too? https://github.com/codex-team/editor.js/issues/2585

2tanhamon avatar Jan 17 '24 07:01 2tanhamon

Hello @loucass003, i also have nested EditorJs and also have the same problem. But i have and another broblem with nested Editor js, maybe did u meet the same problem too? #2585

Sorry we have not. We do not use react for our project maybe something related with that?

loucass003 avatar Jan 17 '24 09:01 loucass003

It would be really good if this could be merged - It would fix an ongoing issue with a popular plugin :

https://github.com/calumk/editorjs-columns/issues/3

calumk avatar Mar 01 '24 10:03 calumk

Could we please prioritize this?

sureshHARDIYA avatar Mar 01 '24 13:03 sureshHARDIYA

Would love to see this fixed =D

vamidi avatar Mar 18 '24 18:03 vamidi

@loucass003 do you have time to write a test for this and submit a clean PR?

@neSpecc I can submit a clean PR but im not familiar with cypress so would probably take me a while to work out how to write the test for this

calumk avatar Mar 22 '24 12:03 calumk

@loucass003 - sorry to bump, but as you originally proposed this, do you have time to write a test for this and submit a clean PR?

calumk avatar Apr 04 '24 10:04 calumk

We're also working with nested EditorJS instances so this would be more than great.

perssonrichard avatar Apr 08 '24 08:04 perssonrichard

Hi @neSpecc - Can you please provide some guidance as to how exactly to test for this?

The issue as i see it is this specific feature (nested editor.js) doesnt exist in any of the default plugins.

So to test with cypress, unless I misunderstand, we would need to add a 3rd-party example plugin to the package devDependencies

This might be something you are unwilling to merge

Either we would need to create a new plugin to test the simpleist intergration, or use an exisiting one, such as my own @calumk/editor-js-columns

Thoughts?

calumk avatar Apr 08 '24 18:04 calumk

this one is blocker for us as well. what approach should be used for the tests?

gorenburg avatar May 03 '24 18:05 gorenburg

What about testing, you can create a Tool Mock what will render editor.js inside own render method. Example https://github.com/codex-team/editor.js/blob/next/test/cypress/tests/modules/BlockEvents/Backspace.cy.ts#L66

neSpecc avatar May 04 '24 15:05 neSpecc

created new PR to fix this issue with tests: https://github.com/codex-team/editor.js/pull/2780

gorenburg avatar Jul 17 '24 14:07 gorenburg

@gorenburg amazing 🤩

calumk avatar Jul 18 '24 07:07 calumk

@neSpecc Are the tests @gorenburg provided sufficiant?

calumk avatar Aug 09 '24 20:08 calumk