Skip to content

Commit

Permalink
fix(hooks): do not add mouse and touch events in React native
Browse files Browse the repository at this point in the history
  • Loading branch information
silviuaavram committed Feb 17, 2023
1 parent 3046bea commit f11503a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hooks/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function getHighlightedIndexOnOpen(props, state, offset) {
* @param {Function} handleBlur Handler on blur from mouse or touch.
* @returns {Object} Ref containing whether mouseDown or touchMove event is happening
*/
function useMouseAndTouchTracker(
function useMouseAndTouchTracker(
isOpen,
downshiftElementRefs,
environment,
Expand All @@ -317,6 +317,10 @@ function getHighlightedIndexOnOpen(props, state, offset) {
})

useEffect(() => {
if (isReactNative) {
return noop
}

// The same strategy for checking if a click occurred inside or outside downsift
// as in downshift.js.
const onMouseDown = () => {
Expand Down

0 comments on commit f11503a

Please sign in to comment.