Skip to content

Commit b4a7d3b

Browse files
committed
fix to pass through the focus in icon to input element
1 parent 05b5c6b commit b4a7d3b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/scripts/DateInput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ export class DateInput extends Component<DateInputProps, DateInputState> {
145145
}
146146

147147
onDateIconClick() {
148+
if (this.input) {
149+
this.input.focus();
150+
}
148151
setTimeout(() => {
149152
this.showDatepicker();
150153
}, 10);
@@ -195,7 +198,7 @@ export class DateInput extends Component<DateInputProps, DateInputState> {
195198
this.props.onComplete();
196199
}
197200
}
198-
}, 500);
201+
}, 10);
199202
}
200203

201204
onDatepickerSelect(dvalue: string) {

src/scripts/Lookup.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ export class LookupSearch extends Component<LookupSearchProps> {
166166
}
167167

168168
onLookupIconClick = () => {
169+
if (this.input) {
170+
this.input.focus();
171+
}
169172
if (this.props.onSubmit) {
170173
this.props.onSubmit();
171174
}
@@ -221,7 +224,7 @@ export class LookupSearch extends Component<LookupSearchProps> {
221224
this.props.onBlur();
222225
}
223226
}
224-
}, 500);
227+
}, 10);
225228
};
226229

227230
handleLookupSearchRef = (node: HTMLDivElement) => {

0 commit comments

Comments
 (0)