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

Commit

Permalink
Address #2413 by making Firefox follow the same behaviour as Chrome (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
mrkev authored and facebook-github-bot committed May 7, 2020
1 parent 7e604b0 commit 6d619c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/component/handlers/edit/DraftEditorEditHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const onPaste = require('editOnPaste');
const onSelect = require('editOnSelect');

const isChrome = UserAgent.isBrowser('Chrome');
const isFirefox = UserAgent.isBrowser('Firefox');

const selectionHandler: (e: DraftEditor) => void = isChrome
? onSelect
: e => {};
const selectionHandler: (e: DraftEditor) => void =
isChrome || isFirefox ? onSelect : e => {};

const DraftEditorEditHandler = {
onBeforeInput,
Expand Down

0 comments on commit 6d619c6

Please sign in to comment.