-
Notifications
You must be signed in to change notification settings - Fork 79
Description
SSCCE
https://ellie-app.com/3Fs3Jr2XMPpa1/0
Problem
Chrome triggers a blur event when removing a DOM node that has focus. If that DOM node happens to be the child of a node that is subject to a p-tagger
patch, then the tagger will have changed by the time the DOM node is removed and, hence, get tagged with the wrong tagger.
Firefox has had a bug open for the past 7 years to add the same behaviour (https://bugzilla.mozilla.org/show_bug.cgi?id=559561)
Other browsers don't seem to exhibit this behaviour. The spec is quite vague on what this should do.
Workarounds
- ensuring the number of taggers is different. This can be done using
Html.map identity
. - ensuring the
Html.map
tree isn't reused by usingHtml.Keyed
nodes.
Possible solutions include:
- removing all eventlisteners before removing a node.
- reverting to
p-redraw
if the taggers changed at all.
This is issue was already (partially) reported in #73 but doesn't really have anything to do with Html.lazy
. Since it came up today in Slack, I figured I'd investigate a little and report my findings here.