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

Allow use of pure::Component within pure::Responsive #1319

Merged
merged 3 commits into from
Apr 26, 2022

Conversation

nicksenger
Copy link
Contributor

Currently, using an iced_lazy::pure::Component within the closure provided to an iced_lazy::pure::Responsive will cause the application to panic. This is because layout on the component is invoked before the widget tree is diffed, so the component's cache has not yet been populated. It's straightforward to reproduce by wrapping the pure/component example in a responsive.

Simply moving the call to diff the widget tree up a couple lines so that it happens before producing the layout appears to resolve the issue.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, good catch! Thanks!

It's a bit worrying that the structure of a widget can cause panics in a different one so easily. Food for thought 🤔

In any case, I think we can merge!

@hecrj hecrj added this to the 0.4.0 milestone Apr 26, 2022
@hecrj hecrj added bug Something isn't working widget labels Apr 26, 2022
@hecrj hecrj merged commit 521be36 into iced-rs:master Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants