Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/solid-turkeys-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

SelectPanel: Remove `usingRemoveActiveDescendant` usage from component
9 changes: 5 additions & 4 deletions packages/react/src/SelectPanel/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ function Panel({
const usingFullScreenOnNarrow = disableFullscreenOnNarrow ? false : featureFlagFullScreenOnNarrow
const shouldOrderSelectedFirst =
useFeatureFlag('primer_react_select_panel_order_selected_at_top') && showSelectedOptionsFirst
const usingRemoveActiveDescendant = useFeatureFlag('primer_react_select_panel_remove_active_descendant')

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

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

// if this is a typeahead event, don't propagate outside of menu
event.stopPropagation()
Expand Down Expand Up @@ -794,7 +795,7 @@ function Panel({
}
: {}),
} as React.CSSProperties,
onKeyDown: usingRemoveActiveDescendant ? preventBubbling(overlayProps?.onKeyDown) : overlayProps?.onKeyDown,
onKeyDown: preventBubbling(overlayProps?.onKeyDown),
}}
focusTrapSettings={focusTrapSettings}
focusZoneSettings={focusZoneSettings}
Expand Down
Loading