Skip to content

Commit 00a5d77

Browse files
authored
fix: exclude active indicator items from content-visibility containment
content-visibility: auto applies paint containment which clips the activeIndicatorLine ::after pseudo-element positioned outside the li bounds. Exclude items with :focus, [data-is-active-descendant], [data-active], and [data-input-focused] from content-visibility: auto so the indicator remains visible.
1 parent fd025fa commit 00a5d77

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/react/src/FilteredActionList/FilteredActionList.module.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
overflow: auto;
1717
flex-grow: 1;
1818

19-
/* Allow the browser to skip rendering for off-screen items, reducing style recalc and layout costs in long lists */
20-
& .ActionListItem {
19+
/* Allow the browser to skip rendering for off-screen items, reducing style recalc and layout costs in long lists.
20+
Exclude items that show the active indicator line, as content-visibility: auto applies paint containment
21+
which clips the absolutely-positioned ::after pseudo-element that renders outside the item bounds. */
22+
& .ActionListItem:not(:focus, [data-is-active-descendant], [data-active], [data-input-focused]) {
2123
content-visibility: auto;
2224
contain-intrinsic-size: auto 32px;
2325
}

packages/react/src/experimental/SelectPanel2/SelectPanel.module.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@
7979
flex-grow: 1;
8080
}
8181

82-
/* Allow the browser to skip rendering for off-screen items, reducing style recalc and layout costs in long lists */
83-
li {
82+
/* Allow the browser to skip rendering for off-screen items, reducing style recalc and layout costs in long lists.
83+
Exclude items that show the active indicator line, as content-visibility: auto applies paint containment
84+
which clips the absolutely-positioned ::after pseudo-element that renders outside the item bounds. */
85+
li:not(:focus, [data-is-active-descendant], [data-active]) {
8486
content-visibility: auto;
8587
contain-intrinsic-size: auto 32px;
8688
}

0 commit comments

Comments
 (0)