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

Support passing a static validation message #1486

Merged
merged 4 commits into from Aug 24, 2021

Conversation

ethanshar
Copy link
Collaborator

Description

Support rendering a validation message in Incubator.TextField component regardless to validate prop
If the user just passed validationMessage without validate prop, we just the render the message with no condition

Fix #1485

Changelog

Support passing a validation message to Incubator.TextField component regardless to validate prop

@ethanshar ethanshar added Important for Next Release PR that must be included in the release version and removed Important for Next Release PR that must be included in the release version labels Aug 24, 2021
@@ -14,9 +15,10 @@ export interface ValidationMessageProps {
*/
validationMessageStyle?: TextStyle;
retainSpace?: boolean;
validate: FieldStateProps['validateOnChange'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
validate: FieldStateProps['validateOnChange'];
validate?: FieldStateProps['validateOnChange'];

Copy link
Contributor

Choose a reason for hiding this comment

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

Somehow this FieldStateProps['validateOnChange'] is a boolean value, and it creates typing errors in the demo-screen on validate prop, that getting there an array of strings

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@ethanshar ethanshar merged commit 0d75038 into master Aug 24, 2021
ethanshar added a commit that referenced this pull request Sep 9, 2021
* Support passing a static validation message regardless to the validate prop

* Fix typing

* Fix validate typing
mendyEdri pushed a commit that referenced this pull request Oct 4, 2021
* Support passing a static validation message (#1486)

* Support passing a static validation message regardless to the validate prop

* Fix typing

* Fix validate typing

* Add leading accessory to example

* Update TextField formatter signature
@ethanshar ethanshar deleted the feat/TextField_staticValidationMessage branch November 30, 2021 08:15
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

Successfully merging this pull request may close these issues.

Incubator.TextField not Support “error” property
2 participants