File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,15 @@ function ReactCustomSearchList(props) {
6363 } ,
6464 [ onKeyDown ] ,
6565 ) ;
66+ useEffect ( ( ) => {
67+ const rEl = document . documentElement ,
68+ input = rootRef . current . querySelector ( 'input' ) ;
69+ const mousedown = ( e ) => open && e . target == input && e . stopImmediatePropagation ( ) ;
70+ rEl . addEventListener ( 'click' , mousedown , { useCapture : true } ) ;
71+ return ( ) => {
72+ rEl . removeEventListener ( 'click' , mousedown , { useCapture : true } ) ;
73+ } ;
74+ } , [ open ] ) ;
6675 useEffect ( ( ) => {
6776 const click = ( e ) => {
6877 setTimeout ( ( ) => {
@@ -80,7 +89,7 @@ function ReactCustomSearchList(props) {
8089 } , [ open ] ) ;
8190 return (
8291 < div className = { `rc-search-suggestions-root ${ theme } ${ corner ? ' corner' : '' } ` } style = { rootStyle } >
83- { open ? (
92+ { open && children != null && children . length ? (
8493 < Popper
8594 rootRef = { rootRef }
8695 style = { popperStyle }
You can’t perform that action at this time.
0 commit comments