muba-input-text 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/InputText.js +2 -1
- package/package.json +1 -1
package/InputText.js
CHANGED
@@ -114,7 +114,8 @@ export default class InputText extends React.Component {
|
|
114
114
|
return false;
|
115
115
|
} else {
|
116
116
|
const pattern = new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])", 'i');
|
117
|
-
const
|
117
|
+
const patternSpaces = new RegExp(/\s/);
|
118
|
+
const success = !!pattern.test(this.props.value) && !patternSpaces.test(this.props.value);
|
118
119
|
|
119
120
|
if (!success) {
|
120
121
|
// It's invalid
|