useBreakpointValue crashes app on mobile Safari ?
See original GitHub issueBug report
Describe the bug
I need to have breakpoint based values for the size
propety on a Drawer and since responsive properties aren’t available for the size
on Drawer
( featured requested here in this issue ) i decided to use useBreakPointValue
, but turns out it’s breaking my application on mobile with this error:
TypeError: mediaQuery.addEventListener is not a function. ( in 'mediaQuery.addEventlistener("change", handleChange), 'mediaQuery.addEventListener' is undefined)
It does work well on the desktop browser tough.
To reproduce
- install
chakra-ui
1.0.0-rc.5. - add
useBreakPointValue
inside of a component - open website on safari mobile, i’m using iOS 13.4.1
const size = useBreakpointValue({ base: 'full', sm: 'xs' })
Expected behavior
Screenshots
System information
- OS: iOS 13.3.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Safari crashing iOS 14 | Apple Developer Forums
The app itself doesnt crash, just the tab crash's. Says problem repeatedly happened on this webpage and page title changes to "Webpage Crashed"....
Read more >useBreakpointValue - Chakra UI
useBreakpointValue is a custom hook which returns the value for the current breakpoint from the provided responsive values object.
Read more >Some iPhone and iPad Users Seeing Strange Safari Crashes ...
Some iPhone and iPad users appear to be experiencing a curious bug in Safari at the current time, with the app crashing when...
Read more >Progressive Web App crashes on Mobile Safari - Stack Overflow
Where I work we're currently making a PWA App. The app runs fine on Android, and on Desktop Chrome and Desktop Safari.
Read more >App crashes on mobile and safari - Bugs - Babylon.js Forum
I'm currently working on an app that uses babylonjs v5.8.2 and that works well on chrome desktop. However it doesn't work on safari...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Someone patched Chakra with the
patch-package
tool over here but it’s a different issue - you might be able to work around that. Else I’m afraid you can only use the fix locally.Yes, i did see that! Thanks for linking.
Since it’s my first project using chakra i decided to download the
theme
pack to understand a bit more how the theme is implemented and hopefully keep the same standards.then later i believe i should move into using
extendTheme
and only do what’s needed, but at this stage i believe i’m still figuring out how it works and it’s very interesting to read the default implementation.