@dloizides/ui-layout 1.24.0 → 1.25.0
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.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -321,6 +321,7 @@ var MENU_MAX_HEIGHT = 300;
|
|
|
321
321
|
var BORDER_RADIUS = 8;
|
|
322
322
|
var BORDER_WIDTH2 = 1;
|
|
323
323
|
var MENU_PADDING = 4;
|
|
324
|
+
var MENU_SCROLL_MAX_HEIGHT = MENU_MAX_HEIGHT - (BORDER_WIDTH2 + MENU_PADDING) * 2;
|
|
324
325
|
var MENU_BOX_SHADOW = "0px 2px 8px rgba(0, 0, 0, 0.15)";
|
|
325
326
|
var MENU_VIEWPORT_MARGIN = 8;
|
|
326
327
|
function buildPortalPopoverStyle(rect, minWidth = 0, viewportWidth = 0) {
|
|
@@ -570,7 +571,10 @@ var styles6 = StyleSheet.create({
|
|
|
570
571
|
// The enter/exit fade+scale lives on an INNER wrapper so the outer popover keeps its raw DOM
|
|
571
572
|
// node (the `menuRef` outside-click / keyboard logic and the web portal target depend on it).
|
|
572
573
|
// `transformOrigin: 'top'` makes the scale grow downward FROM the anchor rather than the centre.
|
|
573
|
-
animated: { transformOrigin: "top" }
|
|
574
|
+
animated: { transformOrigin: "top" },
|
|
575
|
+
// Bound the scroll viewport so a list longer than the popover scrolls (with a scrollbar) instead of
|
|
576
|
+
// overflowing the frame — the popover's own maxHeight cannot do this (see MENU_SCROLL_MAX_HEIGHT).
|
|
577
|
+
scroll: { maxHeight: MENU_SCROLL_MAX_HEIGHT }
|
|
574
578
|
});
|
|
575
579
|
var InlineMenu = ({
|
|
576
580
|
testID,
|
|
@@ -634,7 +638,7 @@ var InlineMenu = ({
|
|
|
634
638
|
"aria-label": accessibilityLabel,
|
|
635
639
|
style: popoverStyle,
|
|
636
640
|
testID: `${testID}-menu`,
|
|
637
|
-
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles6.animated, animatedStyle], children: /* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "handled", children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
641
|
+
children: /* @__PURE__ */ jsx(Animated.View, { style: [styles6.animated, animatedStyle], children: /* @__PURE__ */ jsx(ScrollView, { style: styles6.scroll, keyboardShouldPersistTaps: "handled", children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
638
642
|
OptionRow,
|
|
639
643
|
{
|
|
640
644
|
isHighlighted: index === highlightedIndex,
|