From 8c91b290bacd12c3f3185887e87512acc14846be Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Thu, 15 Jul 2021 10:54:38 +0100 Subject: [PATCH] Select: Block scroll on select instead of trying to hide the menu (#36783) --- packages/grafana-ui/src/components/Select/SelectBase.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/Select/SelectBase.tsx b/packages/grafana-ui/src/components/Select/SelectBase.tsx index 1001cf76b5f..2f904002986 100644 --- a/packages/grafana-ui/src/components/Select/SelectBase.tsx +++ b/packages/grafana-ui/src/components/Select/SelectBase.tsx @@ -177,8 +177,6 @@ export function SelectBase({ closeMenuOnSelect, // We don't want to close if we're actually scrolling the menu // So only close if none of the parents are the select menu itself - closeMenuOnScroll: (scrollEvent: Event) => - !scrollEvent.composedPath().some((pathItem) => (pathItem as Element).classList?.value.includes(styles.menu)), defaultValue, // Also passing disabled, as this is the new Select API, and I want to use this prop instead of react-select's one disabled, @@ -203,6 +201,7 @@ export function SelectBase({ menuPlacement, menuPortalTarget: document.body, menuPosition, + menuShouldBlockScroll: true, menuShouldScrollIntoView: false, onBlur, onChange: onChangeWithEmpty,