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

Fix the issue of composition API and beforeinput event triggering between Chrome versions 60-75 on the Android platform. #5327

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

YasinChan
Copy link
Contributor

Description
We found that the code for determining the conditions of use of the beforeinput event is based on the following code.

export const IS_CHROME_LEGACY =

export const HAS_BEFORE_INPUT_SUPPORT =

Where IS_CHROME_LEGACY determines that Chrome versions smaller than 76 cannot use the beforeinput event. This results in the following example of Chrome version 68 not being able to use beforeinput, resulting in a crash.

Example

bug.mp4

Context
We know from MDN that beforeinput is supported on Android Chrome above version 60, the IS_CHROME_LEGACY method determines that there are some other compatibility considerations below version 76.

But this set of judgments may not apply to the Android side. So we added IS_ANDROID_CHROME_LEGACY judgment for Android side which condition becomes greater than version 59 to use both the beforeinput event, we tested it on version 58 and 68 and it works fine.

Checks

@changeset-bot
Copy link

changeset-bot bot commented Mar 1, 2023

🦋 Changeset detected

Latest commit: baf3254

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

Copy link
Collaborator

@dylans dylans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but the tests are failing so we'll need to determine if this change is the cause:

https://github.com/ianstormtaylor/slate/actions/runs/4302276422/jobs/7500557198

@dylans dylans merged commit 4205e0f into ianstormtaylor:main Mar 2, 2023
@github-actions github-actions bot mentioned this pull request Mar 2, 2023
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.

2 participants