@homebound/beam 3.12.0 → 3.12.2

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.
package/dist/index.cjs CHANGED
@@ -4721,17 +4721,33 @@ function Popper(props) {
4721
4721
  styles,
4722
4722
  attributes
4723
4723
  } = (0, import_react_popper.usePopper)(targetElement, popperRef.current, {
4724
- modifiers: [{
4725
- name: "arrow",
4726
- options: {
4727
- element: arrowRef
4728
- }
4729
- }, {
4730
- name: "offset",
4731
- options: {
4732
- offset: [0, 5]
4724
+ // Use `fixed` positioning so the portaled tooltip is positioned relative to the viewport.
4725
+ // With the default `absolute` strategy the tooltip is appended to `document.body` and counts
4726
+ // toward the document's scroll size, so a trigger near an edge pushes the tooltip past the
4727
+ // document bounds and introduces scrollbars / renders off-screen. `fixed` elements don't
4728
+ // contribute to document scroll size, so they can be kept within the viewport instead.
4729
+ strategy: "fixed",
4730
+ modifiers: [
4731
+ {
4732
+ name: "arrow",
4733
+ options: {
4734
+ element: arrowRef
4735
+ }
4736
+ },
4737
+ {
4738
+ name: "offset",
4739
+ options: {
4740
+ offset: [0, 5]
4741
+ }
4742
+ },
4743
+ // Keep the tooltip inside the viewport (with a small gutter) rather than overflowing it.
4744
+ {
4745
+ name: "preventOverflow",
4746
+ options: {
4747
+ padding: 8
4748
+ }
4733
4749
  }
4734
- }],
4750
+ ],
4735
4751
  placement
4736
4752
  });
4737
4753
  return (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref: popperRef, ...attributes.popper, ...ariaProps, onMouseEnter, onMouseLeave, ...(0, import_runtime2.mergeProps)(void 0, styles.popper, {
@@ -9563,7 +9579,7 @@ function Button(props) {
9563
9579
  };
9564
9580
  return maybeTooltip({
9565
9581
  title: resolveTooltip(disabled, tooltip),
9566
- placement: "top",
9582
+ placement: "bottom",
9567
9583
  children: getButtonOrLink(buttonContent, onPress, buttonAttrs, openInNew, download)
9568
9584
  });
9569
9585
  }