@primer/behaviors 1.5.0-rc.291190a → 1.5.1-rc.b50217f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -151,7 +151,7 @@ function pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingR
151
151
  }
152
152
  if (alternateOrder && positionAttempt < alternateOrder.length) {
153
153
  if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {
154
- pos.top = viewportRect.height + relativeViewportRect.top - floatingRect.height;
154
+ pos.top = Math.max(viewportRect.height + relativeViewportRect.top - floatingRect.height, 0);
155
155
  }
156
156
  }
157
157
  }
@@ -147,7 +147,7 @@ function pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingR
147
147
  }
148
148
  if (alternateOrder && positionAttempt < alternateOrder.length) {
149
149
  if (pos.top + floatingRect.height > viewportRect.height + relativeViewportRect.top) {
150
- pos.top = viewportRect.height + relativeViewportRect.top - floatingRect.height;
150
+ pos.top = Math.max(viewportRect.height + relativeViewportRect.top - floatingRect.height, 0);
151
151
  }
152
152
  }
153
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "1.5.0-rc.291190a",
3
+ "version": "1.5.1-rc.b50217f",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",