Update validation.md
#675 - Using single quotes for pattern does not parse escape sequences.
This commit is contained in:
committed by
Benaiah Mischenko
parent
dbe96d33f9
commit
48e9083fb2
@ -6,7 +6,7 @@
|
|||||||
`- {label: "Subtitle", name: "subtitle", widget: "string", required: false}`
|
`- {label: "Subtitle", name: "subtitle", widget: "string", required: false}`
|
||||||
|
|
||||||
- Pattern: Field configuration can specify a regex pattern with the appropriate error message. Example:
|
- Pattern: Field configuration can specify a regex pattern with the appropriate error message. Example:
|
||||||
`- {label: "Title", name: "title", widget: "string", pattern: [".{10,}", "Should have more than 10 characters"] }`
|
`- {label: "Title", name: "title", widget: "string", pattern: ['.{10,}', "Should have more than 10 characters"] }`
|
||||||
|
|
||||||
|
|
||||||
## Advanced Guide (For widget authors)
|
## Advanced Guide (For widget authors)
|
||||||
@ -51,4 +51,4 @@ You can also return a promise from `isValid`. While the promise is pending, the
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: Do not create a promise inside `isValid` - `isValid` is called right before trying to persist. This means that even if a previous promise was already resolved, when the user hits 'save', `isValid` will be called again. If it returns a new promise, it will be immediately marked as "in error" until the new promise resolves.
|
Note: Do not create a promise inside `isValid` - `isValid` is called right before trying to persist. This means that even if a previous promise was already resolved, when the user hits 'save', `isValid` will be called again. If it returns a new promise, it will be immediately marked as "in error" until the new promise resolves.
|
||||||
|
Reference in New Issue
Block a user