Fix navigaton for <div> with extra style #141
Open
+110
−108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a case of any extra style applied to
<div>
, assigned as Editor container, move canva stop work normally:<div>
, and won't work if it moved and click goes to prawflow-parent.All of this becuase code rely on e.target.classList[0], assuming then it is always only one class assigned to any element, and these classes are pre-defined. It looks true for all the elements, created by editor, but it is not true for container
<div>
which is used to put editor in.Fix: change e.target.classList[0] to matches() for conditions and add looping over all the classes of the element in the esecution part.
[fbe2125] includes meaningful code change.
[17b7841] Incluses just indents change, coming from the code taken into extra loop.
Hope you found it usefull, this made the code a bit more immue to some factors behind of control.