fix(core): use camelCase attribute names in slider for react (#708)

This commit is contained in:
rahim
2026-03-04 10:46:07 -08:00
committed by GitHub
parent 2db6be75be
commit 4e1f3af2d7
4 changed files with 7 additions and 7 deletions
@@ -138,8 +138,8 @@ export class SliderCore {
getAttrs(state: SliderState) {
return {
role: 'slider',
tabindex: state.disabled ? -1 : 0,
autocomplete: 'off',
tabIndex: state.disabled ? -1 : 0,
autoComplete: 'off',
'aria-label': this.getLabel(state),
'aria-valuemin': this.#props.min,
'aria-valuemax': this.#props.max,
@@ -137,8 +137,8 @@ describe('SliderCore', () => {
const attrs = core.getAttrs(state);
expect(attrs.role).toBe('slider');
expect(attrs.tabindex).toBe(0);
expect(attrs.autocomplete).toBe('off');
expect(attrs.tabIndex).toBe(0);
expect(attrs.autoComplete).toBe('off');
expect(attrs['aria-label']).toBe('');
expect(attrs['aria-valuemin']).toBe(0);
expect(attrs['aria-valuemax']).toBe(100);
@@ -153,7 +153,7 @@ describe('SliderCore', () => {
const state = core.getSliderState(0);
const attrs = core.getAttrs(state);
expect(attrs.tabindex).toBe(-1);
expect(attrs.tabIndex).toBe(-1);
expect(attrs['aria-disabled']).toBe('true');
});
@@ -226,7 +226,7 @@ describe('TimeSliderCore', () => {
const attrs = core.getAttrs(state);
expect(attrs['aria-disabled']).toBe('true');
expect(attrs.tabindex).toBe(-1);
expect(attrs.tabIndex).toBe(-1);
});
it('preserves thumbAlignment across getState calls', () => {
@@ -184,7 +184,7 @@ describe('VolumeSliderCore', () => {
const attrs = core.getAttrs(state);
expect(attrs['aria-disabled']).toBe('true');
expect(attrs.tabindex).toBe(-1);
expect(attrs.tabIndex).toBe(-1);
});
});
});