[wp-trac] [WordPress Trac] #49519: Regression: IE11 block editor error when deleting a block using the keyboard
WordPress Trac
noreply at wordpress.org
Wed Feb 26 21:41:11 UTC 2020
#49519: Regression: IE11 block editor error when deleting a block using the
keyboard
-----------------------------------------+---------------------
Reporter: afercia | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.4
Component: Editor | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch has-screenshots | Focuses:
-----------------------------------------+---------------------
Comment (by aduth):
I haven't been able to pinpoint the exact cause yet, and especially why it
would only impact Internet Explorer, but I suspect the issue occurs here
in code:
https://github.com/WordPress/gutenberg/blob/d026d5b/packages/rich-
text/src/component/index.js#L1145
React "Refs" are a common source of these sorts of errors, considering how
they are assigned only after the component's first render, and unassigned
when the component unmounts:
https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-
element
Typically it is a good practice to verify that the ref is assigned before
referencing any of its properties, since otherwise errors like the one in
the original report can occur.
However, it is yet unclear to me:
- Was there some expected guarantee that the ref would always be assigned
if this event handler is reached?
- Why does it only happen in Internet Explorer?
- Would including a guarded condition on the assigned ref break expected
behavior of this focus handler?
Related pull request (cc @iseulde @jorgefilipecosta):
https://github.com/WordPress/gutenberg/pull/19536
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49519#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list