Skip to content

Commit de470d2

Browse files
committed
Phenome: Input - tweak initial validation
1 parent 8fe8153 commit de470d2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/phenome/components/input.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,7 @@ export default {
271271
watch: {
272272
'props.value': function watchValue() {
273273
const self = this;
274-
const {
275-
type,
276-
} = self.props;
274+
const { type } = self.props;
277275

278276
if (type === 'range' || type === 'toggle') return;
279277

@@ -296,7 +294,7 @@ export default {
296294
componentDidMount() {
297295
const self = this;
298296
self.$f7ready((f7) => {
299-
const { validate, resizable, type, clearButton } = self.props;
297+
const { validate, resizable, type, clearButton, value, defaultValue } = self.props;
300298
if (type === 'range' || type === 'toggle') return;
301299

302300
const inputEl = self.refs.inputEl;
@@ -312,8 +310,10 @@ export default {
312310
}
313311

314312
f7.input.checkEmptyState(inputEl);
315-
if (validate) {
316-
f7.input.validate(inputEl);
313+
if (validate && (typeof value !== 'undefined' || typeof defaultValue !== 'undefined')) {
314+
setTimeout(() => {
315+
f7.input.validate(inputEl);
316+
}, 0);
317317
}
318318
if (resizable) {
319319
f7.input.resizeTextarea(inputEl);

0 commit comments

Comments
 (0)