Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebennett88 authored Oct 2, 2023
2 parents d6a9040 + b284329 commit dea5110
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/react-select/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# react-select

## 5.7.5

### Patch Changes

- [`9d1730ba`](https://github.com/JedWatson/react-select/commit/9d1730ba4f97a51d25c7e704acd1a4c2be8f7182) [#5347](https://github.com/JedWatson/react-select/pull/5347) Thanks [@aszmyd](https://github.com/aszmyd)! - Make scroll lock div work on a document context it belongs to

## 5.7.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-select/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-select",
"version": "5.7.4",
"version": "5.7.5",
"description": "A Select control built with and for ReactJS",
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
Expand Down
11 changes: 8 additions & 3 deletions packages/react-select/src/internal/ScrollManager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
import { jsx } from '@emotion/react';
import { Fragment, ReactElement, RefCallback } from 'react';
import { Fragment, ReactElement, RefCallback, MouseEvent } from 'react';
import useScrollCapture from './useScrollCapture';
import useScrollLock from './useScrollLock';

Expand All @@ -14,8 +14,13 @@ interface Props {
readonly onTopLeave?: (event: WheelEvent | TouchEvent) => void;
}

const blurSelectInput = () =>
document.activeElement && (document.activeElement as HTMLElement).blur();
const blurSelectInput = (event: MouseEvent<HTMLDivElement>) => {
const element = event.target as HTMLDivElement;
return (
element.ownerDocument.activeElement &&
(element.ownerDocument.activeElement as HTMLElement).blur()
);
};

export default function ScrollManager({
children,
Expand Down

0 comments on commit dea5110

Please sign in to comment.