-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable use of ResizeObserver for menu auto-updating #5381
Conversation
Resolves #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.
🦋 Changeset detectedLatest commit: 86bf2bf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 86bf2bf:
|
For the major bump release, I wonder if you could use the following so that older browsers could still be supported without requiring a polyfill? |
Thanks for the suggestion, I'm not even sure we have any reason to re-enable it at this point. I'm having trouble trying to think of a situation where the ResizeObserver would be triggered but the other event listeners (scroll and resize on parent) would not, so we might be able to just do without it, even in the next major. |
Thanks. I'm not super familiar with MenuPlacer, but would async loading menu items or changing menu-item heights cause this? |
There are two parts of menu positioning:
This PR only addresses auto-updating the second part of menu positioning. I don't think we have determined yet whether we want to be auto-updating the first part. The second part does not rely on the menu's height at the moment, so async loading menu items or changing menu-item heights would not affect the auto-updating of the menu position the way that it's currently implemented. |
* 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
* Use ResizeObserver to update menu position if available Fixes #5403. I mistakenly thought in #5381 that the resize event was placed on the control element, but's it really just on the scroll parents of the control element. This PR enables `ResizeObserver` if it's available. The referenced issue demonstrates a good use-case for it. * Create tricky-books-design.md
…on#5404) * Use ResizeObserver to update menu position if available Fixes JedWatson#5403. I mistakenly thought in JedWatson#5381 that the resize event was placed on the control element, but's it really just on the scroll parents of the control element. This PR enables `ResizeObserver` if it's available. The referenced issue demonstrates a good use-case for it. * Create tricky-books-design.md
Resolves #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 in the next major.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.