Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

[mdc-slider] support toggling discrete state programmatically #5020

@devversion

Description

@devversion

Feature Request

Currently the mdc-slider has two modes. Continuous and discrete. For authors of components that are based on the MDC foundations, it would be nice to be able to toggle the mode of the slider programmatically.

Currently the slider mode is determined on initialization by checking if a given class exists or not. This is not ideal as re-initializing the slider in favor of changing the internal mode (just so that track markers are rendered) is not acceptable performance-wise.

Proposed solution

Add a method to the foundation like setDiscrete(boolean)

Alternatives considered

Making the isDiscrete_ class member public. A method would not be necessary but would match up with the other public methods on the foundation.

Additional context

Related to angular/components#16795

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions