froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.3k stars 674 forks source link

Error on triple nested list <ol> or <ul> objects: Cannot read properties of null (reading 'querySelector') #4818

Open wvddrss opened 2 months ago

wvddrss commented 2 months ago
Expected behavior.

It should not throw an error which causes the froala editor to freeze and no options are available.

Actual behavior.

It throws an error and causes the froala editor to freeze and no options are available.

Error:

Uncaught TypeError: Cannot read properties of null (reading 'querySelector')
    at s (froala_editor.pkgd.min.js:7:25822)
    at r (froala_editor.pkgd.min.js:7:26299)
    at Object.g [as lists] (froala_editor.pkgd.min.js:7:26303)
    at h (froala_editor.pkgd.min.js:7:130299)
    at Object.L [as set] (froala_editor.pkgd.min.js:7:135815)
    at n (froala_editor.pkgd.min.js:7:523930)
    at Object.E [as toggle] (froala_editor.pkgd.min.js:7:524314)
    at w.Bootstrap.callback (froala_editor.pkgd.min.js:7:525236)
    at Object.n [as exec] (froala_editor.pkgd.min.js:7:44720)
    at c (froala_editor.pkgd.min.js:7:221305)
s @ froala_editor.pkgd.min.js:7
r @ froala_editor.pkgd.min.js:7
g @ froala_editor.pkgd.min.js:7
h @ froala_editor.pkgd.min.js:7
L @ froala_editor.pkgd.min.js:7
n @ froala_editor.pkgd.min.js:7
E @ froala_editor.pkgd.min.js:7
callback @ froala_editor.pkgd.min.js:7
n @ froala_editor.pkgd.min.js:7
c @ froala_editor.pkgd.min.js:7
a @ froala_editor.pkgd.min.js:7
t @ froala_editor.pkgd.min.js:7
d @ froala_editor.pkgd.min.js:7
a @ froala_editor.pkgd.min.js:7
(anonymous) @ froala_editor.pkgd.min.js:7
(anonymous) @ froala_editor.pkgd.min.js:7
Steps to reproduce the problem.

paste following html in editor:

<ol>
    <ol>
        <ol>
            <li><span>item 1</span></li>
            <li><span>item 2</span></li>
        </ol>
           </ol>
</ol>
Editor version.

4.2.1 + 4.2.2

OS.

macOS 14.5 (23F79)

Browser.

Chrome Version 128.0.6613.120

Recording.

https://github.com/user-attachments/assets/c20e496c-d3b9-4d11-af10-41296555e1f1

brambilliet commented 2 months ago

How do I give this bug a thumbs up? Asking for a frustrated friend...

ItaloLeandro02 commented 1 month ago

Froala 4.2.1 does not have this issue.

coreequip commented 1 month ago

This bug still present in v4.3.0.

Steps to reproduce:

It will end up in a 3rd level list item and the editor is throwing the mentioned exception.

mikebertiean commented 2 weeks ago

Same issue.

@wvddrss @brambilliet @coreequip any luck with a workaround here?

coreequip commented 2 weeks ago

Not really. Catching the exception in frontend while waiting for a patch from Froala.

mikebertiean commented 2 weeks ago

@harasunu-narayan any recommendations on this one?

brambilliet commented 2 weeks ago

@ItaloLeandro02 taloLeandro02

Froala 4.2.1 does not have this issue.

Yes it does, even v4.3.0

mikebertiean commented 2 weeks ago

support@froala.com if you haven't reached out yet :) Waiting on a response.

I haven't been able to find a good workaround yet that will make the editor useable.