diff --git a/.changeset/chilled-cougars-shout.md b/.changeset/chilled-cougars-shout.md new file mode 100644 index 0000000..56f3dc8 --- /dev/null +++ b/.changeset/chilled-cougars-shout.md @@ -0,0 +1,5 @@ +--- +"@primer/behaviors": patch +--- + +When zoomed in, an overlay floating element should anchor itself properly instead of getting the top part cut off in the process diff --git a/src/__tests__/anchored-position.test.ts b/src/__tests__/anchored-position.test.ts index 1113b72..bd333d8 100644 --- a/src/__tests__/anchored-position.test.ts +++ b/src/__tests__/anchored-position.test.ts @@ -367,7 +367,7 @@ describe('getAnchoredPosition', () => { expect(left).toEqual(380) // anchorRect.left + anchorRect.width - parentRect.left - floatingRect.width }) - // This test runs for values derived from a real use case https://github.com/github/accessibility-audits/issues/4515 as run on a local storybook. + // This test runs for values derived from a real use case https://github.com/github/accessibility-audits/issues/4515 as seen on a local storybook. it('should overflow to bottom if the element is too tall to fit on the screen when zoomed', () => { const parentRect = makeDOMRect(0, 0, 400, 400) const anchorRect = makeDOMRect(16, 16, 32, 32) // left aligned button