Skip to content
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

🐛 SAFARI: Select and Autocomplete's overlay don't have the correct size on Safari. #908

Closed
alexasselin008 opened this issue Feb 15, 2022 · 5 comments
Assignees
Labels

Comments

@alexasselin008
Copy link
Member

Describe the bug

When using Safari, the select and autocomplete component display the following error in the console:
TypeError: undefined is not an object (evaluating '$(e.borderBoxSize)[0].inlineSize')

This code is used in the useTriggerWidth's code.

This is due to the fact that the resize-observer-polyfill doesn't have a polyfill for the borderBoxSize and contentBoxSize's properties, as per issue que-etc/resize-observer-polyfill#77.

Steps to reproduce

On Safari, open a page with a select or autocomplete control. Notice the error in the console.
The width of the overlay is also different:
image
expected :
image

Expected results

The overlay's width should be the same as the trigger.

@fraincs
Copy link
Contributor

fraincs commented Feb 16, 2022

I agree that this is a bug, at least it's non breaking since the options are visible and actionnable.

@fraincs fraincs self-assigned this Mar 30, 2022
@fraincs
Copy link
Contributor

fraincs commented Mar 31, 2022

The polyfill we are currently using seem pretty much dead. No action at all for a while, should we eventually move to https://github.com/juggle/resize-observer who supports borderBoxSize and contentBoxSize and seems somehow more maintained? From what I read the migration is not a lot of work.

@fraincs
Copy link
Contributor

fraincs commented May 27, 2022

@alexasselin008 any opinions?

@alexasselin008
Copy link
Member Author

alexasselin008 commented Jun 15, 2022

Another suggestion would be investigating if we can move away from borderBoxSize.

Main reasons for only observing content box size are:

  • efficiency: internally, all(?) browser engines store content box size as a variable. The other boxes are computed relative to it. To observe resizes efficiently, all engines have to do is trap writes to this variable. Computing other box sizes introduces many other dependencies, that are complex to compute efficiently.
  • simplicity: narrow standards are more likely to be implemented, and be interoperable.

WICG/resize-observer#34 (comment)

@fraincs
Copy link
Contributor

fraincs commented Aug 25, 2022

This has been fixed on Safari side, testes on Safari Version 15.6.1 (17613.3.9.1.16) and no error in the console, the width is good too.

@fraincs fraincs closed this as completed Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants