-
Notifications
You must be signed in to change notification settings - Fork 323
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
"Save" and "Cancel" buttons for settings sections #11290
Conversation
…y` instead of `isDisabled`)
@@ -26,7 +26,7 @@ interface SubmitButtonBaseProps { | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
readonly form?: FormInstance<any> | |||
/** Defaults to `submit`. */ | |||
readonly action?: 'cancel' | 'submit' | 'update' | |||
readonly action?: 'cancel' | 'save' | 'submit' | 'update' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how's the save is different from 'submit' or 'update'?
On the second thought, why'd we need that at all? we had formnovalidate
which was quirky, but web-compliant, now we have custom prop, that looks very unclear and has very confusing values.
autoFocus = false, | ||
...inputProps | ||
} = props | ||
const formFromContext = Form.useFormContext() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can pass the form prop in the context and the context will return the passed form if it's defined, otherwise will try to consume a form from the context.
@@ -11,6 +11,11 @@ import { tv } from '#/utilities/tailwindVariants' | |||
|
|||
const SETTINGS_INPUT_STYLES = tv({ | |||
extend: INPUT_STYLES, | |||
variants: { | |||
readOnly: { | |||
true: { base: 'opacity-100', textArea: 'border-transparent' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the inputs in settings should be somehow hightlighted, now it's unclear that we can click on the name and edit it, since nothing is making it different from an ordinary text element
@somebody1234 After I click [UPDATE] ok looks like it works but in the background. the new value will appear in the input after reload. please fix |
@PabloBuchu yup, good catch. looks like it is changed internally but because it's separate from the form, the displayed form value doesn't change |
@PabloBuchu should be fixed now |
f32c10a
to
d15076e
Compare
Pull Request Description
Important Notes
None
Screenshots
Before:
After:
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
The documentation has been updated, if necessary.Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Unit tests have been written where possible.