Skip to content

[Form] Create new Form component#589

Merged
atomiks merged 5 commits into
mui:masterfrom
atomiks:feat/Form3
Sep 11, 2024
Merged

[Form] Create new Form component#589
atomiks merged 5 commits into
mui:masterfrom
atomiks:feat/Form3

Conversation

@atomiks

@atomiks atomiks commented Sep 9, 2024

Copy link
Copy Markdown
Contributor

Closes #219

@atomiks atomiks added the component: form Changes related to the form component. label Sep 9, 2024
@mui-bot

mui-bot commented Sep 9, 2024

Copy link
Copy Markdown

return (
<form onSubmit={handleSubmit} noValidate>
<FieldRoot invalid={error}>
<FieldRoot invalid={error} name="email">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name and diasbled were moved back onto <Field.Root> for SSR/layout shift reasons with the server-side errors prop and style hooks.

We should always try to avoid using effects to sync up data for this reason, unless it's a popup element (which requires interaction to appear for the most part, or at least until hydration which won't cause layout shift).

Comment on lines +31 to +40
/**
* Whether the field is disabled. Takes precedence over the `disabled` prop of the `Field.Control`
* component.
* @default false
*/
disabled?: boolean;
/**
* The field's name. Takes precedence over the `name` prop of the `Field.Control` component.
*/
name?: string;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaldudak to avoid changing unrelated components too much, we can do namespace types refactoring in a new PR

Comment thread docs/data/components/form/form.mdx Outdated
Comment thread packages/mui-base/src/Field/Control/useFieldControlValidation.ts Outdated
@atomiks
atomiks merged commit 7c198fb into mui:master Sep 11, 2024
@atomiks
atomiks deleted the feat/Form3 branch September 11, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: form Changes related to the form component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Form] Implement Form

3 participants