You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a nested element is being modified, the cache of the parent's parent is not being invalidated.
This is causing the lengths and index calculations being wrong.
Steps for Reproduction
it('Cache issue',async()=>{letquillRef={};render(<QuillEditorhtml={` <p><b>1<i>2</i>3</b></p> <p><i>567</b=i></p> `}quillRef={quillRef}/>);constquill=quillRef.quill;// get all italicsconstitalics=quill.scroll.descendants(Italic);// Get index of italic, so cache is generatedconstindex1=quill.getIndex(italics[0]);expect(index1).toBe(1);//replace italic with longer textitalics[0].replaceWith('text','21234');// get index of next line constindex2=quill.getIndex(italics[1]);expect(index2).toBe(8);// But 4});
Expected behavior: Index or length to be recalculated
Actual behavior: Index or length being returned from last calculation
When a nested element is being modified, the cache of the parent's parent is not being invalidated.
This is causing the lengths and index calculations being wrong.
Steps for Reproduction
Expected behavior: Index or length to be recalculated
Actual behavior: Index or length being returned from last calculation
Platforms: Any platform
Version: 2.0.2
I had to do this as a workaround right now.
The text was updated successfully, but these errors were encountered: