Skip to content

Commit

Permalink
Disable use of ResizeObserver for menu auto-updating (JedWatson#5381)
Browse files Browse the repository at this point in the history
* Disable use of ResizeObserver for menu auto-update

Resolves JedWatson#5256 (comment).

We do not have an official browser support policy, but it would be nice to delay relying on `ResizeObserver` for a major bump and make our official browser support policy clear.

I do not believe we anticipate the `ResizeObserver` getting triggered in many situations anyway since the menu itself shouldn't be resizing. The scroll events are much more critical to auto-updating working properly.

* Create new-sloths-wink.md
  • Loading branch information
Methuselah96 authored and Rall3n committed Oct 19, 2022
1 parent 77a0ea6 commit 6f92ea3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-sloths-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-select': patch
---

Disable use of ResizeObserver for menu position auto-updating to avoid potential breaking changes.
3 changes: 2 additions & 1 deletion packages/react-select/src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ export const MenuPortal = <
cleanupRef.current = autoUpdate(
controlElement,
menuPortalRef.current,
updateComputedPosition
updateComputedPosition,
{ elementResize: false }
);
}
}, [controlElement, updateComputedPosition]);
Expand Down

0 comments on commit 6f92ea3

Please sign in to comment.