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

Set focus style for contenteditable elements #41200

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MohamadSalman11
Copy link
Contributor

@MohamadSalman11 MohamadSalman11 commented Feb 2, 2025

Description

It's important to make sure contenteditable elements also have a focus style, just like other interactive elements. Some elements, like buttons, don’t get a focus style when they’re made contenteditable, which can hurt the user experience. Now, all contenteditable elements will behave the same way and get a focus style, just like other elements that can be focused. Since contenteditable acts like an input field, it makes sense to give it a focus style too.

Some Examples:

Button Component
Before:
chrome_QDUqyMOYFZ

After:
chrome_IiwCYTqF9s

Card Component
Before:
chrome_FyR4Jw46KY

After:
chrome_T9cwcBUGro

Motivation & Context

To improve consistency, ensuring that all contenteditable elements receive a focus style enhances the user experience across the site

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

@MohamadSalman11 MohamadSalman11 requested a review from a team as a code owner February 2, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

2 participants