Skip to content

Commit

Permalink
BASIRA #257 - Adding "refine" as callback dependency; Fixing issue wi…
Browse files Browse the repository at this point in the history
…th end input always displaying
  • Loading branch information
dleadbetter committed Nov 29, 2024
1 parent 9f52cab commit 067479a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/semantic-ui/src/components/FacetSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const FacetSlider = forwardRef(({ useRangeSlider, ...props }: Props, ref: HTMLEl
}

refine(v);
}, []);
}, [refine]);

/**
* Parses the input strings, sets the value on the state, and sets a timer to call "refine".
Expand All @@ -85,7 +85,7 @@ const FacetSlider = forwardRef(({ useRangeSlider, ...props }: Props, ref: HTMLEl
// Use a timer to only refine the value when the user stops typing
clearTimer();
setTimer(() => onChangeComplete(newValue));
}, [onChangeComplete]);
}, [getInputValue, onChangeComplete]);

/**
* Sets the view value when to/from change.
Expand Down Expand Up @@ -136,10 +136,12 @@ const FacetSlider = forwardRef(({ useRangeSlider, ...props }: Props, ref: HTMLEl
textAlign='right'
>
{ !props.editable && value[1] }
<Input
onChange={(e, data) => onChange(value[0], data.value)}
value={value[1]}
/>
{ props.editable && (
<Input
onChange={(e, data) => onChange(value[0], data.value)}
value={value[1]}
/>
)}
</Grid.Column>
</Grid>
</div>
Expand Down

0 comments on commit 067479a

Please sign in to comment.