Provide a general summary of the feature here
This is the same ask as #2315 but for a different reason. For sliders that are used for media (e.g. an audio progress bar) they will always be left-to-right (ltr). See "Media Players" in https://m3.material.io/foundations/layout/bidirectionality-rtl for a good explanation of this.
Right now in our application we're doing this:
const { locale, direction } = useLocale();
return (
<I18nProvider locale={direction === 'rtl' ? 'en-US' : locale}>
<Slider ... />
</I18nProvider>
);
...to hackily workaround the limitation highlighted in #2315
🤔 Expected Behavior?
Support indicating the direction of a slider independently from the current locale.
😯 Current Behavior
Currently the direction of the slider is tied to the current locale - but in right-to-left languages there are left-to-right sliders.
💁 Possible Solution
Ideally we could provide a direction prop which controls reverseX independently of I18nProvider so that we can avoid overriding the locale given that has other formatting implications:
const { ... } = useSlider(
{
direction: 'ltr',
},
state,
trackRef,
);
An alternative version of this could be a reversed property which defaults to true for direction === 'rtl':
const { ... } = useSlider(
{
reversed: false,
},
state,
trackRef,
);
🔦 Context
See "Media Players" in https://m3.material.io/foundations/layout/bidirectionality-rtl for a good explanation of this.
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Provide a general summary of the feature here
This is the same ask as #2315 but for a different reason. For sliders that are used for media (e.g. an audio progress bar) they will always be left-to-right (ltr). See "Media Players" in https://m3.material.io/foundations/layout/bidirectionality-rtl for a good explanation of this.
Right now in our application we're doing this:
...to hackily workaround the limitation highlighted in #2315
🤔 Expected Behavior?
Support indicating the direction of a slider independently from the current locale.
😯 Current Behavior
Currently the direction of the slider is tied to the current locale - but in right-to-left languages there are left-to-right sliders.
💁 Possible Solution
Ideally we could provide a
directionprop which controlsreverseXindependently ofI18nProviderso that we can avoid overriding thelocalegiven that has other formatting implications:An alternative version of this could be a
reversedproperty which defaults totruefordirection === 'rtl':🔦 Context
See "Media Players" in https://m3.material.io/foundations/layout/bidirectionality-rtl for a good explanation of this.
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response