Skip to content

Commit 70cfa40

Browse files
committed
Fix crash when typing in DateInput with only one input
1 parent 329c7ba commit 70cfa40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DateInput.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ export default class DateInput extends PureComponent {
240240
}
241241

242242
get divider() {
243-
return this.placeholder.match(/[^0-9a-z]/i)[0];
243+
const dividers = this.placeholder.match(/[^0-9a-z]/i);
244+
return dividers ? dividers[0] : null;
244245
}
245246

246247
get placeholder() {

0 commit comments

Comments
 (0)