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: nested component layout invalidation #1169

Merged

Conversation

nicksenger
Copy link
Contributor

This PR modifies on_event for Component and its corresponding Overlay to also invalidate the layout if that of the local_shell is invalidated by the cached element during its processing of events.

Without this, layout invalidation is 'swallowed' in some cases when using nested components, causing potential panics and other weird behavior in subsequent draws. I've put a simple-ish repro case in this gist

@hecrj hecrj added the bug Something isn't working label Dec 27, 2021
@hecrj hecrj added this to the 0.4.0 milestone Dec 27, 2021
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.

Good catch!

I implemented Shell::merge to take care of this, but we are not relying on it here.

@hecrj hecrj merged commit 5466d6a into iced-rs:master Dec 27, 2021
@nicksenger nicksenger deleted the fix/nested-component-layout-invalidation branch February 17, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants