Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Missing onMouseUp and onKeyUp selection handlers in Firefox #2413

Closed
miketaylr opened this issue May 6, 2020 · 0 comments
Closed

Missing onMouseUp and onKeyUp selection handlers in Firefox #2413

miketaylr opened this issue May 6, 2020 · 0 comments

Comments

@miketaylr
Copy link

I'm filing this issue regarding the following:

https://bugzilla.mozilla.org/show_bug.cgi?id=1625475#c15

It seems that this difference between Chrome and Firefox prevents editing tweets that contain emojis (on twitter.com, which uses DraftJS).

I made a very simple React demo to look at differences in onSelect behavior with contenteditable events at https://bugzilla.mozilla.org/show_bug.cgi?id=1625475#c21, but didn't observe any differences between Chrome and Firefox to see where the bug may be.

Would it be possible to get more context around aed35d2?

I discovered that the draft editor manages this state through the contenteditable div's onSelect event, but it is not being fired in certain cases.

If not, perhaps DraftJS should treat Firefox the same way it does Chrome in this instance -- that fixes the Twitter emoji bug.

facebook-github-bot pushed a commit that referenced this issue May 7, 2020
…2414)

Summary:
All info is in the #2413 and this [Bugzilla issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1625475).

Noteworthy from that Bugzilla thread is [comment 16](https://bugzilla.mozilla.org/show_bug.cgi?id=1625475#c16):

> I added a selectionchange listener to the document of Twitter, and I tried reproducing this with the STR in comment 10. Then, I confirmed that selectionchange event is fired as expected both on Firefox (Nightly) and Chrome (Release) when I click middle of the text node. So, **it might be a bug of React if the onSelect is not called as expected...**

This is worth future investigation, but for now let's just fix the bug.
Pull Request resolved: #2414

Reviewed By: kedromelon

Differential Revision: D21443875

Pulled By: mrkev

fbshipit-source-id: 8bd099ddc44e3c4cdac679e1d605c4da5146c1e8
@mrkev mrkev closed this as completed May 9, 2020
vilemj-Viclick pushed a commit to kontent-ai/draft-js that referenced this issue Jul 16, 2020
…our as Chrome (facebookarchive#2414)

Summary:
All info is in the facebookarchive#2413 and this [Bugzilla issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1625475).

Noteworthy from that Bugzilla thread is [comment 16](https://bugzilla.mozilla.org/show_bug.cgi?id=1625475#c16):

> I added a selectionchange listener to the document of Twitter, and I tried reproducing this with the STR in comment 10. Then, I confirmed that selectionchange event is fired as expected both on Firefox (Nightly) and Chrome (Release) when I click middle of the text node. So, **it might be a bug of React if the onSelect is not called as expected...**

This is worth future investigation, but for now let's just fix the bug.
Pull Request resolved: facebookarchive#2414

Reviewed By: kedromelon

Differential Revision: D21443875

Pulled By: mrkev

fbshipit-source-id: 8bd099ddc44e3c4cdac679e1d605c4da5146c1e8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants