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

Add @DisableIf() #59

Open
void0-0 opened this issue Mar 20, 2023 · 0 comments
Open

Add @DisableIf() #59

void0-0 opened this issue Mar 20, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@void0-0
Copy link

void0-0 commented Mar 20, 2023

A simple decorator that would disable the control if a given condition is met. Similar to how @AddValidatorIf works where a validator is added if a given condition is met but instead of adding a validator it would disable the control.

In order for the form to not ignore the field, I recommend simply applying a css class similar to this one by default:

.disabled {
    @apply opacity-50 select-none pointer-events-none;
}

And maybe through the use of a configuration object we could pass to the decorator we could specify if we actually want the default behavior of disabled fields.

@void0-0 void0-0 self-assigned this Mar 20, 2023
@void0-0 void0-0 added the enhancement New feature or request label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant