[✨] onResize$ #262
Replies: 5 comments
-
|
Ok after doing a decent bit of research it looks like we do need some sort event such as I think it's a pretty common use case to want to track an element's dimensions. Currently, we cannot do that without a resize observer, which will not execute unless we do it on page load. Such as If we wanted to keep with the principles of delaying the execution of code as much as possible, I think this would be a needed event in the framework https://discord.com/channels/842438759945601056/1041016608946135161/1182393506019418193 |
Beta Was this translation helpful? Give feedback.
-
|
Closed a duplicate issue, but I think it has further context Is your feature request related to a problem? Parent Unfortunately, the current solution is to use a resize observer, and we need some sort of javascript on page load. Describe the solution you'd like This is intuitive and similar to container queries in css, but we can programmatically change UI based on the container size. Describe alternatives you've considered Trying to create the html element as a store to see track its nested properties Additional context |
Beta Was this translation helpful? Give feedback.
-
|
I ❤️ this idea. Here are my thoughts. I think we should create a custom event similar to Implementation detail:
NOTE: We could also use this code to make the Would anyone be up for this? Happy to provide support along the way. |
Beta Was this translation helpful? Give feedback.
-
|
@mhevery sure! Not as acquainted with core as I'd like to be, but I think this is an important piece for anyone wanting to do more complex UI. Do we need to try out |
Beta Was this translation helpful? Give feedback.
-
|
We moved this issue to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
Often, components can be made responsive using pure CSS with media queries and container queries; however, some components have to manage their own display when dynamically resized. Currently, this is handled by creating a
ResizeObserverby hand. It would be convenient if the framework provided a simple API for setting up resize behavior, and created theResizeObserverunder the hood.Describe the solution you'd like
This feature could be implemented as an
onResize$attribute that could be added to any Qwik component.Example:
Describe alternatives you've considered
Setting up a
ResizeObserverby hand.Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions