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) {
63
63
} ,
64
64
[ onKeyDown ] ,
65
65
) ;
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 ] ) ;
66
75
useEffect ( ( ) => {
67
76
const click = ( e ) => {
68
77
setTimeout ( ( ) => {
@@ -80,7 +89,7 @@ function ReactCustomSearchList(props) {
80
89
} , [ open ] ) ;
81
90
return (
82
91
< div className = { `rc-search-suggestions-root ${ theme } ${ corner ? ' corner' : '' } ` } style = { rootStyle } >
83
- { open ? (
92
+ { open && children != null && children . length ? (
84
93
< Popper
85
94
rootRef = { rootRef }
86
95
style = { popperStyle }
You can’t perform that action at this time.
0 commit comments