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 default focus styles #5422

Merged
merged 2 commits into from
May 26, 2023

Conversation

Chudesnov
Copy link
Contributor

@Chudesnov Chudesnov commented May 12, 2023

Resolves #5146

Description
Prevents default focus styles from being removed, making the behaviour opt-in via <Editable>'s style prop or other CSS

Issue
Fixes: #5146

Example
Screenshot 2023-05-12 at 19 43 04

Context
Since Slate.js does not provide any custom focus styles for the editable area, it should not remove the built-in focus style which is required per WCAG criterion Focus Visible

If a particular focus styling technique is preferred by library authors (e.g. highlighting the whole area with :focus-within), it should be described in the relevant documentation article (e.g. https://www.slatejs.org/examples/styling) rather than being hard-coded in the Editable component.

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 12, 2023

🦋 Changeset detected

Latest commit: 625e4ab

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

@dylans dylans merged commit 0b17990 into ianstormtaylor:main May 26, 2023
12 checks passed
@github-actions github-actions bot mentioned this pull request May 26, 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.

Built-in focus styles in Editable
2 participants