material-components / material-components/material-components-android

[Slider] Allow null value

Open
#4,984 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: Slider
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
We don't want the slider to always have a selected value -- we're using it in a context where the end user could choose to leave it blank.

**Describe the solution you'd like**
When the slider has a `null` value, don't display the handle. Display the slider itself as though the bottom of the range were selected (none of it shaded in).

**Describe alternatives you've considered**
We previously extended the slider to hide the handle when the backing value is `null` but it's a brittle approach that broke with the latest version of the component: https://github.com/getodk/collect/pull/6987

Thanks for the consideration!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named in the issue. Start by locating the Android Slider component and its existing value and handle-rendering tests. Confirm the null-value behavior and run the relevant slider tests to verify that the handle is hidden and the track is unshaded.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.