Skip to content

feat(ui5-slider, ui5-range-slider): make tickmarks visual-only#13441

Open
MapTo0 wants to merge 5 commits intomainfrom
feat/slider-custom-values
Open

feat(ui5-slider, ui5-range-slider): make tickmarks visual-only#13441
MapTo0 wants to merge 5 commits intomainfrom
feat/slider-custom-values

Conversation

@MapTo0
Copy link
Copy Markdown
Contributor

@MapTo0 MapTo0 commented Apr 29, 2026

Summary

  • Custom tickmarks are now purely visual labels at specific positions on the scale
  • The slider moves freely based on min/max/step regardless of tickmark positions (no snapping)
  • When the current value matches a tickmark value, its label is shown in the tooltip and announced via aria-valuetext
  • Added tickmarks property to ui5-range-slider (previously only on ui5-slider)
  • Removed the "custom values mode" that previously overrode min/max/step and snapped exclusively to tickmark values

BREAKING CHANGE

The tickmarks property no longer causes the slider to snap exclusively to defined values. Users must now set min/max/step explicitly alongside tickmarks.

Test plan

  • Slider tests pass (53 tests)
  • RangeSlider tests pass (90 tests, 8 new for custom tickmarks)
  • SliderScale tests pass (14 tests)
  • Manual test: Slider and RangeSlider test pages with custom tickmarks allow free movement
  • Manual test: Labels display correctly at tickmark positions
  • Manual test: Tooltip shows label when value matches a tickmark, numeric value otherwise

MapTo0 added 2 commits April 29, 2026 16:20
Allow developers to define custom non-numeric labels on slider tick marks
by setting the `tickmarks` property with an array of {value, label} objects.

When set, the slider enters "custom values" mode:
- Handle snaps only to defined tickmark values
- Custom labels are displayed on the scale
- Tooltip shows the custom label instead of numeric value
- aria-valuetext announces the custom label for accessibility
- min/max are auto-derived from tickmark values
- Tickmarks auto-show without requiring show-tickmarks attribute
- step property is ignored (navigation moves between defined values)
- Editable tooltip is disabled (only defined values are valid)

Resolves #9730, resolves #9058
@ui5-webcomponents-bot
Copy link
Copy Markdown
Collaborator

ui5-webcomponents-bot commented Apr 29, 2026

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview April 29, 2026 13:29 Inactive
MapTo0 added 2 commits May 5, 2026 13:34
Custom tickmarks now serve as visual labels at specific positions
on the scale without affecting slider movement. The slider moves
freely based on min/max/step regardless of tickmark positions.

When the current value matches a tickmark value, its label is
shown in the tooltip and announced via aria-valuetext.

BREAKING CHANGE: The tickmarks property no longer causes the slider
to snap exclusively to defined values. Users must set min/max/step
explicitly alongside tickmarks.
@MapTo0 MapTo0 changed the title feat(ui5-slider): support custom values via tickmarks property feat(ui5-slider, ui5-range-slider): make tickmarks visual-only May 5, 2026
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview May 5, 2026 11:52 Inactive
Interactive page with 6 open design questions for review:
1. Tooltip text for in-between values
2. Magnetic snap behavior
3. Keyboard Ctrl+Arrow jump targets
4. Minor ticks between labeled tickmarks
5. Label density/overflow handling
6. Range slider in-range label emphasis
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview May 5, 2026 12:06 Inactive
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