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

Test for WebKit based browsers instead of Safari #5437

Merged
merged 2 commits into from
May 31, 2023

Conversation

josephmr
Copy link
Contributor

@josephmr josephmr commented May 30, 2023

Description
The previous IS_SAFARI test did not catch some WebKit based environments that should have the special cased behavior. For example, running Slate inside a webview on iOS would result in a userAgent like: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" which would not match the previous IS_SAFARI definition, but does have the same quirks since it is WebKit based.

Issue
No matching issue reported.

Example
One manifestation of this is the special behavior for Chrome/Safari (i.e. WebKit) for handling deleting selected inline voids relevant code.

Prior to this change in a webview on iOS it would fail to delete a selected inline void since this special cased behavior wouldn't fire -- in these videos the input is a webview inside a react-native application; the webview is then using Slate and "design-triage" is an inline void element:

Screen.Recording.2023-05-30.at.10.59.40.AM.mov

After this change it deletes as expected:

Screen.Recording.2023-05-30.at.10.56.35.AM.mov

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.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

@changeset-bot
Copy link

changeset-bot bot commented May 30, 2023

🦋 Changeset detected

Latest commit: 602e8c7

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 Minor

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

@josephmr josephmr marked this pull request as ready for review May 30, 2023 18:09
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