Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace IS_FIREFOX with IS_FIREFOX_LEGACY in HAS_BEFORE_INPUT_SUPPORT #4150

Merged
merged 5 commits into from
Mar 31, 2021
Merged

Conversation

nivekithan
Copy link
Contributor

@nivekithan nivekithan commented Mar 30, 2021

Description

Firefox did not support onBeforeInput event so code used React leaky SyntheticEvent as a fallback. Which leads certain bugs like

But as of Firefox/87 onBeforeInput is supported mdn

Issue

Context
So instead of checking if the browser is firefox we will check if the browser is firefox and version is less than 87. If thats true only then we will fallback to React SyntheticEvent

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)

@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2021

🦋 Changeset detected

Latest commit: ad8e557

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
slate-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nivekithan nivekithan mentioned this pull request Mar 30, 2021
4 tasks
@ianstormtaylor
Copy link
Owner

Thanks @nivekithan!

@ianstormtaylor ianstormtaylor merged commit bbd7d9c into ianstormtaylor:master Mar 31, 2021
This was referenced Mar 31, 2021
@TheSpyder
Copy link
Collaborator

#4118 is probably a better fix, rather than version detection?

Also fixes #3185

dylans added a commit to dylans/slate that referenced this pull request May 4, 2021
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.
ianstormtaylor added a commit that referenced this pull request May 5, 2021
* Update IS_FIREFOX_LEGACY flag to prevent FF crash

#4118 and #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 #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>
ulion pushed a commit to xliulian/slate that referenced this pull request May 22, 2021
…ianstormtaylor#4150)

* replace IS_FIREFOX with IS_FIREFOX_LEGACY in HAS_BEFORE_INPUT_SUPPORT

* fix linting errors

* Create afraid-donuts-flow.md

* Update environment.ts

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
# Conflicts:
#	packages/slate-react/src/utils/environment.ts
ulion pushed a commit to xliulian/slate that referenced this pull request May 28, 2021
* 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
dylans added a commit to dylans/slate that referenced this pull request Sep 13, 2021
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants