From d6a904081ca6b5188d081bd03d852e273e98adf5 Mon Sep 17 00:00:00 2001 From: Tuomo Raitila Date: Tue, 13 Jun 2023 11:01:46 +0300 Subject: [PATCH] Fix for calling non-cancellable scroll events --- .changeset/brown-lemons-film.md | 5 +++++ packages/react-select/src/internal/useScrollCapture.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/brown-lemons-film.md diff --git a/.changeset/brown-lemons-film.md b/.changeset/brown-lemons-film.md new file mode 100644 index 0000000000..59fc1fb74a --- /dev/null +++ b/.changeset/brown-lemons-film.md @@ -0,0 +1,5 @@ +--- +'react-select': patch +--- + +Fix for calling non-cancellable scroll events diff --git a/packages/react-select/src/internal/useScrollCapture.ts b/packages/react-select/src/internal/useScrollCapture.ts index 6452d6564e..03b8bd9f59 100644 --- a/packages/react-select/src/internal/useScrollCapture.ts +++ b/packages/react-select/src/internal/useScrollCapture.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef } from 'react'; import { supportsPassiveEvents } from '../utils'; const cancelScroll = (event: WheelEvent | TouchEvent) => { - event.preventDefault(); + if (event.cancelable) event.preventDefault(); event.stopPropagation(); };