Skip to content

Commit c61825d

Browse files
committed
stop propagation in instances of onclear closing menus
Signed-off-by: gitdallas <5322142+gitdallas@users.noreply.github.com>
1 parent 83f42ef commit c61825d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/react-core/src/demos/CustomMenus/examples/InlineSearchFilterMenuDemo.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export const InlineSearchFilterMenuDemo: React.FunctionComponent = () => {
7878
value={input}
7979
aria-label="Filter menu items"
8080
onChange={(_event, value) => handleTextInputChange(value)}
81-
onClear={() => handleTextInputChange('')}
81+
onClear={(event) => {
82+
event.stopPropagation();
83+
handleTextInputChange('');
84+
}}
8285
/>
8386
</MenuSearchInput>
8487
</MenuSearch>

packages/react-core/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,10 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
337337
aria-label="Filter menu items"
338338
value={searchValue}
339339
onChange={(_event, value) => onTextChange(value)}
340-
onClear={() => onTextChange('')}
340+
onClear={(event) => {
341+
event.stopPropagation();
342+
onTextChange('');
343+
}}
341344
/>
342345
</MenuSearchInput>
343346
<Divider />

0 commit comments

Comments
 (0)