Skip to content

Commit

Permalink
enhance: Make sure slider trigger focus event on track click (#982)
Browse files Browse the repository at this point in the history
* 10.6.0

* enhance: trigger blur before focus
  • Loading branch information
zombieJ authored Apr 19, 2024
1 parent 92afa24 commit e15d955
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-slider",
"version": "10.6.0-4",
"version": "10.6.0",
"description": "Slider UI component for React",
"keywords": [
"react",
Expand Down
1 change: 1 addition & 0 deletions src/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ const Slider = React.forwardRef<SliderRef, SliderProps<number | number[]>>((prop
onBeforeChange?.(getTriggerValue(cloneNextValues));
triggerChange(cloneNextValues);
if (e) {
(document.activeElement as HTMLElement)?.blur?.();
handlesRef.current.focus(valueIndex);
onStartDrag(e, valueIndex, cloneNextValues);
}
Expand Down

0 comments on commit e15d955

Please sign in to comment.