-
Notifications
You must be signed in to change notification settings - Fork 150
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
PropertyFieldNumber control suggestion #36
Comments
I implemented the More information on using a beta version can be found here: https://sharepoint.github.io/sp-dev-fx-property-controls/beta/ In the dev branch you can find the documentation of the new property: https://github.com/SharePoint/sp-dev-fx-property-controls/blob/4e6bfee36855cd25fba51df292c231d9d72fdaeb/docs/documentation/docs/controls/PropertyFieldNumber.md |
It looks like this is exactly what I'm looking for. I feel the documentation is a little open to interpretation though, but that it could be me. The documentation states that the function is used to both get the validation message and validate the input.
Does that mean that my earlier example could be implemented as following:
It would make sense that if the error message is empty that there is no error. Is that the case? |
The controls behavior should be as close to the behavior of the default controls used in SPFx. So that is why I implemented it via the I had implemented your sample in the documentation:
Your code will also work. |
Category
[ x ] Enhancement
[ ] Bug
[ x ] Question
Version
Please specify what version of the library you are using: [ 1.4.1 ]
Expected / Desired Behavior / Question
It would be great if I could configure a property as a Function. This function can be used to validate the number in the field. This would allow me to have more control over the input number. A quick example for only allowing evens:
If the evaluation function fails it could display the custom message which could default to "The custom evaluation failed.".
The text was updated successfully, but these errors were encountered: