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

Propagate disabled state to descendants #231

Closed
wants to merge 1 commit into from

Conversation

pieterdd
Copy link
Contributor

@pieterdd pieterdd commented Dec 27, 2023

This is a fix for Descendants of a disabled View apply disabled behavior, but not disabled styling. The code sample in that thread worked correctly for me after the code change:

image

For more context about why propagation of disabled state matters, see this example. The approach where classes are applied to child components and modified upon disabling of the parent doesn't work in all cases, plus it requires parent components to interfere with child components. Propagating the disabled state seemed like a better separation of concerns.

@dzhou121
Copy link
Contributor

Thanks for the PR. But this approach is quite expensive.

I tried to fix it in e795021, can you please check if that works?

@pieterdd
Copy link
Contributor Author

I'm happy to report that e795021 works correctly in all cases I tested. Thank you for the fix.

@pieterdd pieterdd closed this Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants