Hi there. The s-popover positioning logic seems off for tall popovers when positioning the popover below the controller would cause the bottom of the popover to go off screen. In these cases, it positions above the controlling button and is almost entirely invisible. While having tall popovers like this isn’t good, it seems like showing more would be better than less.
You can test this easily:
import { useId } from "react";
export default function WrongWayPopover() {
const smallPopover = useId();
const mediumPopover = useId();
const largePopover = useId();
return (
<s-page heading="Additional">
<s-stack direction="inline" gap="small-300">
<s-button commandFor={largePopover} command="--toggle">
Large
</s-button>
<s-button commandFor={mediumPopover} command="--toggle">
Medium
</s-button>
<s-button commandFor={smallPopover} command="--toggle">
Small
</s-button>
</s-stack>
<s-popover id={smallPopover} minBlockSize="200px">
This is a small popover.
</s-popover>
<s-popover id={mediumPopover} minBlockSize="500px">
This is a medium popover.
</s-popover>
<s-popover id={largePopover} minBlockSize="1200px">
This is a large popover.
</s-popover>
</s-page>
);
}
With the large popover (on my screen), it does this:
In the interim I am setting the max block size so the popovers don’t get to tall – but this leads to them being smaller than they need to be (with unnecessary scrolling) on some screens. I’m hoping the folks at Shopify (@KyleG-Shopify, @Anthony_Frehner, @Alan_G, et al) will make sure this gets prioritised on their internal tracker.
I would also like to raise this issue. It’s the only web component that has scaling issues and it’s bad enough I have to use react popovers despite having everything designed and ready to go as a web component
Thank you, I would like to remove the polaris react from all our applications but the popover functionality is a blocker right now for anything with dynamic content.
They are dynamic in height but well over 500px in the tests where it is evident. They were working fine when I made that initial comment about it working and with no changes to my mockups and test implementation they stopped working in both react and HTML.
I tried using inline size with overflow but it really does not work well compared to how it was just working a few days ago.
How do you set API versions on web components? I thought it was always the same script everyone has to use from shopify cloud
I just tried 700px and it was fine as well. Are yours positioned at the very top within an s-section?
Oh, I’m not sure why I had Admin UI Extensions in mind for a moment. We do use the same script for embedded apps, you’re right Sorry for the confusion there!