File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,9 +338,9 @@ function SelectTree({
338338 return res ;
339339 } , [ options ] ) ;
340340
341- const handleOpen = useEventCallback ( ( ev : React . MouseEvent < HTMLElement > ) => {
341+ const handleOpen = useEventCallback ( ( ) => {
342342 setOpenState ( true ) ;
343- setMinMenuWidth ( ev . currentTarget . clientWidth ) ;
343+ setMinMenuWidth ( inputRef . current ?. clientLeft ) ;
344344 onOpen ?.( ) ;
345345 } ) ;
346346
@@ -463,7 +463,8 @@ function SelectTree({
463463 const handleKeyDown : React . HTMLAttributes < HTMLInputElement > [ "onKeyDown" ] =
464464 useEvent ( ( ev ) => {
465465 if ( ev . key === "Enter" || ev . key == " " ) {
466- handleOpen ( ev ) ;
466+ handleOpen ( ) ;
467+ ev . preventDefault ( ) ;
467468 }
468469 } ) ;
469470
@@ -510,6 +511,7 @@ function SelectTree({
510511 value = { inputValue }
511512 sx = { { p : 1 , width : "100%" } }
512513 InputProps = { {
514+ autoFocus : true ,
513515 startAdornment : < Icon name = "search" size = { 16 } color = "#555" /> ,
514516 endAdornment : (
515517 < IconButton size = "small" onClick = { handleClickResetInput } >
You can’t perform that action at this time.
0 commit comments