mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-12 12:03:06 +08:00
Fix a bug with Label submit
This commit is contained in:
@@ -22,7 +22,7 @@ export const LabelRadioGroup = (props: LabelRadioGroupProps) => {
|
||||
clickHandler={(newValue) => {
|
||||
const newState = labelValues.slice();
|
||||
newState[idx] = newValue;
|
||||
props.onChange(labelValues);
|
||||
props.onChange(newState);
|
||||
setLabelValues(newState);
|
||||
if (!interactionFlag) setInteractionFlag(true);
|
||||
}}
|
||||
|
||||
@@ -22,7 +22,7 @@ export const LabelSliderGroup = ({ labelIDs, onChange, isEditable }: LabelSlider
|
||||
sliderHandler={(sliderValue) => {
|
||||
const newState = sliderValues.slice();
|
||||
newState[idx] = sliderValue;
|
||||
onChange(sliderValues);
|
||||
onChange(newState);
|
||||
setSliderValues(newState);
|
||||
}}
|
||||
isEditable={isEditable}
|
||||
@@ -49,7 +49,12 @@ function CheckboxSliderItem(props: {
|
||||
{/* TODO: display real text instead of just the id */}
|
||||
<span className={labelTextClass}>{props.labelId}</span>
|
||||
</label>
|
||||
<Slider defaultValue={0} isDisabled={!props.isEditable} onChangeEnd={(val) => props.sliderHandler(val / 100)}>
|
||||
<Slider
|
||||
aria-roledescription="slider"
|
||||
defaultValue={0}
|
||||
isDisabled={!props.isEditable}
|
||||
onChangeEnd={(val) => props.sliderHandler(val / 100)}
|
||||
>
|
||||
<SliderTrack>
|
||||
<SliderFilledTrack />
|
||||
<SliderThumb />
|
||||
|
||||
Reference in New Issue
Block a user