OptionsUI: SliderValueEditor does not get auto focused on slider change (#59209)

This commit is contained in:
Laura Fernández 2022-11-24 18:21:33 +01:00 committed by GitHub
parent 220295d26f
commit 45d3125919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -87,7 +87,11 @@
"ignoreNonDOM": true
}
],
"jsx-a11y/no-static-element-interactions": "off"
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/label-has-associated-control": [ "error", {
"controlComponents": ["NumberInput"],
"depth": 2
}]
}
}
]

View File

@ -96,7 +96,7 @@ export const SliderValueEditor: React.FC<FieldConfigEditorProps<number, SliderFi
<div className={cx(styles.container, styles.slider)}>
{/** Slider tooltip's parent component is body and therefore we need Global component to do css overrides for it. */}
<Global styles={styles.slider} />
<div className={cx(styles.sliderInput, ...sliderInputClassNames)}>
<label className={cx(styles.sliderInput, ...sliderInputClassNames)}>
<Slider
min={min}
max={max}
@ -113,7 +113,7 @@ export const SliderValueEditor: React.FC<FieldConfigEditorProps<number, SliderFi
<span className={stylesSlider.numberInputWrapper} ref={inputRef}>
<NumberInput value={sliderValue} onChange={onSliderInputChange} max={max} min={min} step={step} />
</span>
</div>
</label>
</div>
);
};