File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/components/experimental/DatePicker Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,12 @@ type CommonProps = Pick<FieldProps, 'description' | 'errorMessage'> & {
4747 id ?: string ;
4848 name ?: string ;
4949 /** focus input on mount */
50- autoFocus : boolean ;
50+ autoFocus ?: boolean ;
51+ onBlur ?: React . FocusEventHandler ;
5152} ;
5253
5354type SingleProps = CommonProps & {
54- mode : 'single' ;
55+ mode ? : 'single' ;
5556 value : Date | null ;
5657 onChange : ( date : Date | null ) => void ;
5758} ;
@@ -118,7 +119,8 @@ function DatePickerImpl(props: DatePickerProps): JSX.Element {
118119 maxValue,
119120 isDisabled,
120121 isInvalid,
121- autoFocus
122+ autoFocus,
123+ onBlur
122124 } = props ;
123125
124126 // legacy compat
@@ -344,6 +346,7 @@ function DatePickerImpl(props: DatePickerProps): JSX.Element {
344346 handleSelectSingle ( next ) ;
345347 } }
346348 autoFocus = { autoFocus }
349+ onBlur = { onBlur }
347350 actionIcon = {
348351 < Button
349352 ref = { triggerRef }
@@ -391,6 +394,7 @@ function DatePickerImpl(props: DatePickerProps): JSX.Element {
391394 readOnly,
392395 autoFocus,
393396 onBlur : event => {
397+ onBlur ?.( event ) ;
394398 const nextEl = event . relatedTarget as HTMLElement | null ;
395399 if ( nextEl && nextEl === triggerRef . current ) return ;
396400 if ( modeLocal === 'single' ) commitSingle ( event . currentTarget . value ) ;
You can’t perform that action at this time.
0 commit comments