Skip to content

Commit

Permalink
feat: add onblur to local time picker (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaynethiessen committed Apr 1, 2024
1 parent b3004de commit 08c1316
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -22,6 +22,7 @@ export function LocalTimePicker(props: LocalTimePickerProps): JSX.Element {
const {
value,
onChange,
onBlur,
as,
action,
actionPosition,
Expand Down Expand Up @@ -66,6 +67,10 @@ export function LocalTimePicker(props: LocalTimePickerProps): JSX.Element {
transparent,
};

const handleDatePickerBlur = (e: React.FocusEvent<HTMLInputElement>) => {
onBlur && onBlur(e);
};

return (
<DatePicker
{...rest}
Expand All @@ -80,9 +85,10 @@ export function LocalTimePicker(props: LocalTimePickerProps): JSX.Element {
dateFormat="hh:mm aa"
customInput={
<Input {...inputProps}>
<MaskedTimeInput {...inputProps} />
<MaskedTimeInput {...inputProps} onBlur={handleDatePickerBlur} />
</Input>
}
onBlur={handleDatePickerBlur}
/>
);
}

0 comments on commit 08c1316

Please sign in to comment.