We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bae31e commit 846252cCopy full SHA for 846252c
ContextMenu/ContextMenuPresentationController.swift
@@ -58,7 +58,12 @@ class ContextMenuPresentationController: UIPresentationController {
58
59
override var frameOfPresentedViewInContainerView: CGRect {
60
guard let containerBounds = containerView?.bounds else { return .zero }
61
- let size = presentedViewController.preferredContentSize
+ var size = presentedViewController.preferredContentSize
62
+
63
+ // cap size to inset container bounds
64
+ size.width = min(containerBounds.width - 2 * item.options.containerStyle.edgePadding, size.width)
65
+ size.height = min(containerBounds.height - 2 * item.options.containerStyle.edgePadding, size.height)
66
67
let frame: CGRect
68
if let corner = preferredSourceViewCorner {
69
let minPadding = item.options.containerStyle.edgePadding
0 commit comments