Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit f5b7e57

Browse files
committed
Don't show menu when input is unfocused
1 parent de78883 commit f5b7e57

File tree

1 file changed

+13
-17
lines changed
  • assets/js/base/components/dropdown-selector

1 file changed

+13
-17
lines changed

assets/js/base/components/dropdown-selector/index.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,19 @@ const DropdownSelector = ( {
124124
value={ inputValue }
125125
/>
126126
</DropdownSelectorInputWrapper>
127-
<DropdownSelectorMenu
128-
checked={ checked }
129-
getItemProps={ getItemProps }
130-
getMenuProps={ getMenuProps }
131-
highlightedIndex={ highlightedIndex }
132-
options={
133-
isOpen && ! isDisabled
134-
? options.filter(
135-
( option ) =>
136-
! inputValue ||
137-
option.value.startsWith(
138-
inputValue
139-
)
140-
)
141-
: []
142-
}
143-
/>
127+
{ isOpen && ! isDisabled && (
128+
<DropdownSelectorMenu
129+
checked={ checked }
130+
getItemProps={ getItemProps }
131+
getMenuProps={ getMenuProps }
132+
highlightedIndex={ highlightedIndex }
133+
options={ options.filter(
134+
( option ) =>
135+
! inputValue ||
136+
option.value.startsWith( inputValue )
137+
) }
138+
/>
139+
) }
144140
</div>
145141
) }
146142
</Downshift>

0 commit comments

Comments
 (0)