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

[custom-field] Propagate invalid state to child components #7953

Open
sissbruecker opened this issue Oct 8, 2024 · 0 comments
Open

[custom-field] Propagate invalid state to child components #7953

sissbruecker opened this issue Oct 8, 2024 · 0 comments

Comments

@sissbruecker
Copy link
Contributor

sissbruecker commented Oct 8, 2024

Describe your motivation

An invalid custom field shows an error message but child fields are not highlighted with the same red background that they would have when used standalone. For the Flow component, propagating the invalid state from the custom field to child components is relatively easy to achieve by enabling manual validation mode on child components and then overriding setInvalid to also mark child components as invalid.

However when using web component declaratively with Lit or React there is no easy solution to this. You'd have to get notified about the invalid state being changed on the custom field, and then set it on child components using refs, or create a state variable for the invalid state and then bind it to each child component. As automatic validation can not be disabled on child components the states might also get out of sync.

Describe the solution you'd like

Maybe custom field should propagate its invalid state to child fields by default. Or there should be an option to enable such a behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant