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

Make HAS_BEFORE_INPUT_SUPPORT flag more generic. #4118

Merged
merged 7 commits into from
Apr 13, 2021

Conversation

kamilkazmierczak
Copy link
Contributor

Description
HAS_BEFORE_INPUT_SUPPORT flag is currently resolved based on type of browser but should be detected for every browser by itself.

Issue
Fixes: #3185, #3800

Context
It's impossible to use slate on IE11 because this flag currently does not include IE11, also it is not proper way of detecting whether feature is enabled in browser or not. I left IS_CHROME_LEGACY because of existing comment saying that feature is available but is not working properly.
Detection mechanism was taken from https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/getTargetRanges#feature_detection

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.)

kamilkazmierczak referenced this pull request Apr 1, 2021
…#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>
williamstein added a commit to sagemathinc/cocalc that referenced this pull request Apr 2, 2021
@changeset-bot
Copy link

changeset-bot bot commented Apr 13, 2021

🦋 Changeset detected

Latest commit: 566b49e

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

@ianstormtaylor
Copy link
Owner

Thanks @kamilkazmierczak!

@ianstormtaylor ianstormtaylor merged commit 6a13763 into ianstormtaylor:main Apr 13, 2021
@github-actions github-actions bot mentioned this pull request Apr 13, 2021
beorn pushed a commit to beorn/slate that referenced this pull request Apr 13, 2021
* Change "HAS_BEFORE_INPUT_SUPPORT" flag to more generic.

* Fix patterns and styles issues.

* Fix lint issues.

* Create dirty-rabbits-speak.md

* Update dirty-rabbits-speak.md

* Update editable.tsx

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
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
* Change "HAS_BEFORE_INPUT_SUPPORT" flag to more generic.

* Fix patterns and styles issues.

* Fix lint issues.

* Create dirty-rabbits-speak.md

* Update dirty-rabbits-speak.md

* Update editable.tsx

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firefox does not fire beforeinput events
2 participants