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 Validation to Typography #16628

Closed
1 task done
DavidSichau opened this issue May 16, 2019 · 1 comment
Closed
1 task done

Add Validation to Typography #16628

DavidSichau opened this issue May 16, 2019 · 1 comment

Comments

@DavidSichau
Copy link
Contributor

DavidSichau commented May 16, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

With Typography Editable one can design read friendly Pages. Where editing only happens infrequently.

However there is missing a nice way to validate the input on changes. For example when an email field is changed to an invalid field.

It would be nice if one could provide some way to validate the input field like on Forms.

What does the proposed API look like?

<Form.Item label="E-mail">
          {getFieldDecorator('email', {
            rules: [
              {
                type: 'email',
                message: 'The input is not valid E-mail!',
              },
              {
                required: true,
                message: 'Please input your E-mail!',
              },
            ],
          })(<Typography.Text editable />)}
</Form.Item>
@zombieJ
Copy link
Member

zombieJ commented May 16, 2019

Typography is a light way component with edit ability. Using Typography with Form is miss use by our design language. No recommend to do this.

But you can still wrap Typography as form-able customize component.

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

No branches or pull requests

3 participants