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

Fix: polyfill not working on iOS Safari below 14.5 #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

colbat
Copy link

@colbat colbat commented Mar 12, 2024

Fix an issue where the polyfill is not working on iOS Safari versions below 14.5. It leads to the container queries being ignored and the style being applied regardless of the container query conditions.

The check for the :where() support on these iOS versions below 14.5 is returning false even though it should be supported from Safari 14.0 (from what we can see on caniuse). This leads to the style breaking and we can also see the warnings in the console. It seems that CSS.supports() for selectors is not working.

image.
(Screenshot taken from lambdatest on an iPhone 12 Pro Safari iOS 14.1)

I replaced this check by checking for document.querySelector(':where(div)'); instead in a try catch which seems to fix the issue.

To be noted, the issue is not happening on macOS, I could reproduce the issue only on iPhones and iPad.

Could be related to #80

@colbat colbat mentioned this pull request Mar 12, 2024
@dwhiterei
Copy link

@colbat Do you have a compiled version of this fix anywhere? I have a sneaking suspicion this pull request isn't getting acted on any time soon... and I kinda need an iOS 14 fix toot sweet.

@JuSeonmi
Copy link

JuSeonmi commented May 29, 2024

@colbat,
hi~ I am the issue writer! Sorry for the late reply, but I really appreciate the correction.
I also agree with dwhiterei's opinion. because it was announced in the readme... We are not planning to add more features or enhancements. I would like to use this modified version. how can I use it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants