Skip to content

Safari 15 has ResizeObserver API but it still does not work #112

Answered by ZeeCoder
205g0 asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like Safari does not support the box property as advertised here.
The properties are not actually available, which is why you're not getting a size report when you ask for border-box.
(content-box should work fine.)

This really highlights how experimental all this is, and support is weird too.

For example, in Chrome / FF, RO will actually respond with all box sizes, regardless of what you're actually asking for. 🤷‍♂️

I might be mistaken, but I think this behaviour is actually against the spec.

You can test browser support by running this little code snippet:

new ResizeObserver((entries) => {
	console.log(entries[0])
}).observe(document.body, {
	box: 'border-box'
});

Replies: 14 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ZeeCoder
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #85 on August 21, 2024 06:39.