Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draftail on firefox crashes when first input into empty field is Cyrillic #11728

Open
ElectronicRU opened this issue Mar 5, 2024 · 0 comments
Labels
status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug

Comments

@ElectronicRU
Copy link

ElectronicRU commented Mar 5, 2024

Issue Summary

When using a RichTextField or a RichTextBlock, the initial empty field crashes if the first input is Cyrillic, only on Firefox. Typing some Latin input, erasing it, and typing a Cyrillic letter also triggers the bug. Draftail instances hosted on draftail.org seem unaffected by this bug.

Steps to Reproduce

https://github.com/ElectronicRU/wagtail-rtf-bug - a wagtail start project with minimal changes, build and run as usual.

  1. Start a new project with wagtail start project
  2. Edit home.models to include a RichTextField
  3. Start the server and open the CMS in FIrefox (no repro in Chromium, my version 123.0 Ubuntu snap).
  4. Type а Cyrillic character into the field.
DOMException: Node.removeChild: The node to be removed is not a child of this node
    hl http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    gu http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    unstable_runWithPriority http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    Bi http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    vu http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    ru http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    Ki http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    unstable_runWithPriority http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    Bi http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    Ki http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    qi http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    M http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
    Kt http://localhost:8080/static/wagtailadmin/js/vendor.js?v=0b071504:2
vendor.js:2:145994

Here's a relevant snippet from vendor.js:

          if (5 === o.tag || 6 === o.tag) {
            e: for (var s = e, l = o, c = n, d = l; ; ) if (du(s, d, c), null !== d.child && 4 !== d.tag) d.child.return = d,
            d = d.child;
             else {
              if (d === l) break e;
              for (; null === d.sibling; ) {
                if (null === d.return || d.return === l) break e;
                d = d.return
              }
              d.sibling.return = d.return,
              d = d.sibling
            }
            a ? (
              s = r,
              l = o.stateNode,
              8 === s.nodeType ? s.parentNode.removeChild(l) : s.removeChild(l)
            ) : r.removeChild(o.stateNode)
          }

Technical details

  • Python version: 3.11
  • Django version: repro on 4.1, 5.0
  • Wagtail version: repro on 5.2.3, 6.0
  • Browser version: Firefox 123.0

Working on this

I'm not great at debugging JS browser differences, so I'm probably not of much use personally.

@ElectronicRU ElectronicRU added status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug labels Mar 5, 2024
@ElectronicRU ElectronicRU changed the title RichTextField (not RichTextBlock) on firefox crashes on Cyrillic input Draftail on firefox crashes on Cyrillic input Mar 5, 2024
@ElectronicRU ElectronicRU changed the title Draftail on firefox crashes on Cyrillic input Draftail on firefox crashes when first input into empty field is Cyrillic Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug
Projects
None yet
Development

No branches or pull requests

1 participant