Multiple Editors in the same View #3088
-
Hi TipTap Community I wan't to ask if someone else had a problem (or successfully) setting up multiple editors on the same view. We have a huge problem when iterating editors and remove one of them. It will always remove the last editor in the iteration, even when the element in the middle should be removed. We have made an issue and also codesandbox where its very easy to reproduce the problem.
Does anyone has an idea of what we could try to fix this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I am also having the same issue |
Beta Was this translation helpful? Give feedback.
-
I believe the issue experienced was due to using the array index as the If a more unique or random key is used, everything should work as expected. Example forked from the original sandbox Relevant Vue docs: Maintaining State with key, Key API |
Beta Was this translation helpful? Give feedback.
I believe the issue experienced was due to using the array index as the
key
for the items loop. When using ordered numerical indexes, when removing an item, the following item assumes the same index as the item removed. Vue will not update a nested component in this case.If a more unique or random key is used, everything should work as expected.
Example forked from the original sandbox
Relevant Vue docs: Maintaining State with key, Key API