-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 ability to make the <SaveButton> not disabled by default #5002
Add ability to make the <SaveButton> not disabled by default #5002
Conversation
a6ba1f2
to
756e23c
Compare
223d110
to
722619e
Compare
Why is this a breaking change? |
People who use directly the So most of the time it's not a breaking change. But for some isolated cases, it could be one minor breaking change. It's better to mention it just in case. |
Implements #4913
To build this feature I allow the user to pass a new prop named
alwaysEnableSaveButton
to the<Toolbar>
which forces enabling ou disabling the<SaveButton>
. If the user doesn't specify this prop, we keep the classic behaviour by disabling the button until the form is dirty.Todo
<SaveButton>
to be disabled by passing thedisabled
propalwaysEnableSaveButton
in the<Toolbar>
and implements its mechanismalwaysEnableSaveButton
prop has not been explicitly passed to the<Toolbar>
but move the logic to the<Toolbar>
instead of the<SaveButton>
(possible breaking change here)Example
How to force enabling the
<SaveButton>
without rewriting the whole<Toolbar>
:If you don't pass the disabled prop, the behaviour "pristine equals to disabled" will be applied as before.
Screenshots
The following screenshots are outdated because the prop has changed. You need to use
alwaysEnableSaveButton
instead ofdisabled
and invert the condition.Force enabling the
<SaveButton>
Force disabling the
<SaveButton>
Keep the pristine equals to disabled mechanism