Skip to content

Commit 9e87c99

Browse files
authored
Merge pull request #403 from mashmatrix/fix-date-input-blur
Fix date input value becomes empty on clicking calendar icon
2 parents b461987 + 71e88e6 commit 9e87c99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/scripts/DateInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ class DateInputInner extends Component<
200200
}
201201

202202
onInputBlur(e: FocusEvent<HTMLInputElement | HTMLButtonElement>) {
203-
this.setValueFromInput(e.target.value);
203+
if (e.target.tagName.toLowerCase() === 'input') {
204+
this.setValueFromInput(e.target.value);
205+
}
204206
setTimeout(() => {
205207
if (!this.isFocusedInComponent()) {
206208
if (this.props.onBlur) {

0 commit comments

Comments
 (0)