Skip to content
Draft
Changes from 2 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
12 changes: 7 additions & 5 deletions packages/@react-spectrum/s2/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ let popover = style(
default: 'elevated',
isArrowShown: 'none'
},
outlineStyle: 'solid',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

I'm not sure if there was reason we were using outline over borders. However, since overflow: auto was moved to the popover and not inner div, the outline was appearing on top of the scrollbar. Using border ensures that it appears underneath.

*ignore the squished image, i didn't want it take up too much space but you can see where the outline is

@yihuiliao yihuiliao Jun 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for context, i previously changed the popover to use border instead of outline bc the outline was now rendering on top of the scrollbar since i move overflow: auto to the outer div. but this caused the popover to shift bc borders participate in the box models whereas outline doesn't. we could move to box shadows but we already have

boxShadow: {
    default: 'elevated',
    isArrowShown: 'none'
},

and i'd rather not mess with it just for this.

are we okay with the outline appearing on top of the scrollbar? or can anyone think of a better solution?

i can't clip the scrollbar to the border radius bc that would require overflow: hidden' but we need overflow: auto` so that the outer element gets focused.

outlineWidth: 1,
outlineColor: {
borderStyle: 'solid',
borderWidth: 1,
borderColor: {
default: lightDark('transparent-white-25', 'gray-200'),
forcedColors: 'ButtonBorder'
},
outlineStyle: 'none',
width: {
size: {
// Copied from designs, not sure if correct.
Expand Down Expand Up @@ -154,7 +155,8 @@ let popover = style(
isolation: 'isolate',
pointerEvents: {
isExiting: 'none'
}
},
overflow: 'auto'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right soooo the only issue with overflow: auto is now it clips the arrow...

it would be nice to go this route though bc browsers will focus the scrollable container and then users can keyboard up/down so not much code (but then no arrow)

we might have to shift focus to the inner div instead to preserve the popover's arrow but not sure how that would play around with submenu's for example

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow me to cook for a bit...

},
getAllowedOverrides()
);
Expand Down Expand Up @@ -322,7 +324,7 @@ const innerDivStyle = style(
boxSizing: 'border-box',
outlineStyle: 'none',
borderRadius: 'inherit',
overflow: 'auto',
// overflow: 'auto',
position: 'relative',
width: 'full',
maxSize: 'inherit'
Expand Down