Skip to content

Commit

Permalink
Update IS_FIREFOX_LEGACY flag to prevent FF crash (ianstormtaylor#4237)
Browse files Browse the repository at this point in the history
* Update IS_FIREFOX_LEGACY flag to prevent FF crash

ianstormtaylor#4118 and ianstormtaylor#4150 introduced IS_FIREFOX_LEGACY, but this block of code was not updated to reflect that. This breaks insertion of emoji and unicode characters in slate-react. This change fixes ianstormtaylor#3855.

* Update editable.tsx

* Create forty-mails-roll.md

* Update editable.tsx

Apologies, in my tests I was using yarn patch and didn't need to modify the import statement, hopefully this will pass CI now.

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
# Conflicts:
#	packages/slate-react/src/components/editable.tsx
  • Loading branch information
dylans authored and ulion committed May 28, 2021
1 parent 40d242f commit a99e55a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Hotkeys from '../utils/hotkeys'
import {
IS_IOS,
IS_FIREFOX,
IS_FIREFOX_LEGACY,
IS_SAFARI,
IS_EDGE_LEGACY,
IS_CHROME_LEGACY,
Expand Down Expand Up @@ -634,7 +635,7 @@ export const Editable = (props: EditableProps) => {
// aren't correct and never fire the "insertFromComposition"
// type that we need. So instead, insert whenever a composition
// ends since it will already have been committed to the DOM.
if (!IS_SAFARI && !IS_FIREFOX && !IS_IOS && event.data) {
if (!IS_SAFARI && !IS_FIREFOX_LEGACY && event.data) {
Editor.insertText(editor, event.data)
}
}
Expand Down

0 comments on commit a99e55a

Please sign in to comment.