We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcc46b0 commit b506ca1Copy full SHA for b506ca1
packages/dataviews/src/dataform-controls/utils/validated-input.tsx
@@ -55,11 +55,13 @@ export default function ValidatedText< Item >( {
55
);
56
57
// Convert pattern to string if it's a RegExp
58
- const pattern = isValid?.pattern
59
- ? isValid.pattern instanceof RegExp
60
- ? isValid.pattern.source
61
- : isValid.pattern
62
- : undefined;
+ let pattern;
+ if ( isValid?.pattern ) {
+ pattern =
+ isValid.pattern instanceof RegExp
+ ? isValid.pattern.source
63
+ : isValid.pattern;
64
+ }
65
66
return (
67
<ValidatedInputControl
0 commit comments