Skip to content

Commit b78167a

Browse files
TylerJDevCopilot
andauthored
SelectPanel: Remove feature flag from preventBubbling (#7192)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 424cbc5 commit b78167a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.changeset/solid-turkeys-shop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': patch
3+
---
4+
5+
SelectPanel: Remove `usingRemoveActiveDescendant` usage from component

packages/react/src/SelectPanel/SelectPanel.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ function Panel({
216216
const usingFullScreenOnNarrow = disableFullscreenOnNarrow ? false : featureFlagFullScreenOnNarrow
217217
const shouldOrderSelectedFirst =
218218
useFeatureFlag('primer_react_select_panel_order_selected_at_top') && showSelectedOptionsFirst
219-
const usingRemoveActiveDescendant = useFeatureFlag('primer_react_select_panel_remove_active_descendant')
220219

221220
// Single select modals work differently, they have an intermediate state where the user has selected an item but
222221
// has not yet confirmed the selection. This is the only time the user can cancel the selection.
@@ -755,8 +754,10 @@ function Panel({
755754
const hasModifier = event.ctrlKey || event.altKey || event.metaKey
756755
if (hasModifier) return
757756

758-
// skip if it's not a alphabet key
759-
if (!isAlphabetKey(event.nativeEvent as KeyboardEvent)) return
757+
// skip if it's not the forward slash or an alphabet key
758+
if (event.key !== '/' && !isAlphabetKey(event.nativeEvent as KeyboardEvent)) {
759+
return
760+
}
760761

761762
// if this is a typeahead event, don't propagate outside of menu
762763
event.stopPropagation()
@@ -794,7 +795,7 @@ function Panel({
794795
}
795796
: {}),
796797
} as React.CSSProperties,
797-
onKeyDown: usingRemoveActiveDescendant ? preventBubbling(overlayProps?.onKeyDown) : overlayProps?.onKeyDown,
798+
onKeyDown: preventBubbling(overlayProps?.onKeyDown),
798799
}}
799800
focusTrapSettings={focusTrapSettings}
800801
focusZoneSettings={focusZoneSettings}

0 commit comments

Comments
 (0)