react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Popover arrow missplacend in certain conditions

Open rohijai opened this issue 4 years ago โ€ข 10 comments

๐Ÿ› Bug Report

When the trigger button is close to the bottom edge of the page, the popup will not render correctly. It starts collapsing and also tip gets miss-aligned

๐Ÿค” Expected Behavior

Tip should not be miss-aligned and should be stick to popover dialog

๐Ÿ˜ฏ Current Behavior

Getting miss-aligned

๐Ÿ’ป Code Sample

๐ŸŒ Your Environment

https://codesandbox.io/s/dawn-breeze-3d6er

Software Version(s)
react-spectrum 3.10.0
Browser Chrome, Safari, Firefox
Operating System Mac

๐Ÿงข Your Company/Team

Working with Adobe Color Team

๐Ÿ•ท Tracking Issue (optional)

rohijai avatar Aug 30 '21 10:08 rohijai

Mind adding some screenshots of what you are seeing? Is this the issue you are talking about? image

LFDanLu avatar Aug 30 '21 17:08 LFDanLu

Yes. Adding screenshot of actual scenario

Screenshot 2021-08-03 at 14 31 25

rohijai avatar Aug 30 '21 17:08 rohijai

In that screenshot, what is the trigger button for the popover?

LFDanLu avatar Aug 30 '21 18:08 LFDanLu

Rectangle area with green border is a trigger button (also tip is pointing to it only).

rohijai avatar Aug 31 '21 05:08 rohijai

I see, I'm not sure how much we can do here since we need the tip to be positioned next to the button but at the same time we don't want the popover to partially render out of view. I'll bring it up with the team.

LFDanLu avatar Aug 31 '21 16:08 LFDanLu

Talked with the team, perhaps we could add some additional logic for changing the popover positioning when this happens or adjust the boundary of the popover, will need some investigation.

LFDanLu avatar Sep 01 '21 20:09 LFDanLu

Sure.

rohijai avatar Sep 02 '21 06:09 rohijai

We will investigate shifting the popover arrow automatically in cases like this and look into refining the overlay positioning code.

LFDanLu avatar Sep 22 '21 18:09 LFDanLu

After reviewing the two exploration PRs above and a third party solution with Spectrum we've decided to reduce padding to 6px when the trigger is at a boundary. For the extreme cases when the trigger is at the boundary and the arrow can not point at the trigger and remain nicely connected to the popover, the arrow will be removed.

ktabors avatar Jan 26 '22 23:01 ktabors

Reopening since there is some additional refinement required, PR for tracking: https://github.com/adobe/react-spectrum/pull/3454

LFDanLu avatar Aug 26 '22 19:08 LFDanLu

Fixed by https://github.com/adobe/react-spectrum/pull/4220

LFDanLu avatar Mar 29 '23 19:03 LFDanLu