-
-
Notifications
You must be signed in to change notification settings - Fork 19.8k
feat(components): [color-picker-panel] hue-slider a11y #22258
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
Conversation
commit: |
|
Size Change: +273 B (+0.02%) Total Size: 1.55 MB
ℹ️ View Unchanged
|
|
🧪 Playground Preview: https://element-plus.run/?pr=22258 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the color picker panel's hue slider component with accessibility features and keyboard navigation improvements. The changes refactor the hue slider to use a shared slider composable with the alpha slider and add comprehensive keyboard support.
- Refactored hue slider to use shared
useSlidercomposable for consistency - Added keyboard navigation with Home, End, PageUp, PageDown keys for precise color control
- Enhanced accessibility with proper ARIA attributes and screen reader support for current color announcements
Reviewed Changes
Copilot reviewed 73 out of 73 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/locale/lang/*.ts | Added new localization keys for hue slider accessibility labels and descriptions |
| packages/components/color-picker-panel/src/props/slider.ts | Consolidated slider props and types for both alpha and hue sliders |
| packages/components/color-picker-panel/src/composables/use-slider.ts | Refactored into generic slider composable supporting both alpha and hue sliders |
| packages/components/color-picker-panel/src/components/hue-slider.vue | Complete rewrite using new composable with accessibility improvements |
| packages/components/color-picker-panel/src/components/alpha-slider.vue | Updated to use refactored composables and added accessibility features |
| packages/components/color-picker-panel/src/utils/draggable.ts | Removed preventDefault call to fix focus issues |
| packages/components/color-picker-panel/src/tests/color-picker-panel.test.tsx | Added test for hue slider keyboard navigation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.The hue slider is opposite in direction to the regular slider.
When controlled through the keyboard, I manually reverse it. But there will still be unreasonable behavior (press the ArrowUp key, but the value decreases).
Perhaps only by changing the design can this issue be completely fixed.