Repository navigation
feat: add editable values to Slider and RangeSlider - #10978
Open
reidbarber wants to merge 9 commits into
Open
reidbarber wants to merge 9 commits into
reidbarber wants to merge 9 commits into
Conversation
…ti-thumb RAC support: - S2: Replaced `isEditable` with `<SliderInput />` in order to keep `AriaNumberField`/`NumberParser` out of non-editable slider bundles. Renders a single field for `Slider` and a shared `start – end` `FieldGroup` (`role="presentation"`) with per-input auto-width sizing inside a fixed-width container for `RangeSlider`. - RAC: Added RTL-aware `ArrowLeft`/`ArrowRight` boundary focus handoff across slotted `NumberField`s and `GroupContext` disabled propagation.
RAC:
- Bind NumberFields to thumbs only when they have an explicit index slot.
- Label slotted fields with the slider's own labelling ids so an external aria-labelledby is forwarded instead of the group's id.
- Commit pending field text before a track press starts a drag, so the commit no longer ends the gesture or fires onChangeEnd early.
- Avoid instanceof checks so arrow-key and commit work for inputs owned by another window.
Hooks:
- Track thumb editability in state instead of a ref, registered from a layout effect, so the Slider re-renders when a thumb's disabled state changes.
S2:
- Show the value output when a conditional SliderInput is not rendered, e.g. {isEditable && <SliderInput />}.
- Focus the correct range input when clicking the separator in RTL, based on the rendered input positions.
- Use 12px gap for size="S" on slider controls and side labels, and update matching minWidths (including RangeSlider track minWidth) - Start-align RangeSlider SliderInput values instead of centering - Apply font-variant-numeric: tabular-nums directly to SliderInput <input> elements - Focus the nearest range input when clicking or tapping in FieldGroup padding
Keep batched endpoint updates from overwriting each other while preserving controlled slider drag callbacks.
Inspect nested fragments when detecting editable children so the standard value output remains visible when no input is rendered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes
Summary
Slider values currently support dragging and keyboard adjustment, but not direct numeric entry. This adds an optional editable field for precise input.
<SliderInput />composition to Spectrum 2SliderandRangeSlider, with size-aware styling and a shared field for range endpoints.NumberFieldcomposition in RAC, synchronizing values, bounds, steps, formatting, and disabled state.📝 Test Instructions
Test Slider and RangeSlider in S2. Test in RAC with single and multi-thumb support.
Release impact
✅ PR Checklist
🧢 Your Project