       bubbleOffset = -(arrowPosition.y - arrowSize.height)
     }
     
-    let topSpace = frame.origin.y - containerView.frame.origin.y
-    let bottomSpace = containerView.frame.height - topSpace - frame.height
-    
-    if bubbleOffset < 0 && topSpace < abs(bubbleOffset) {
-      bubbleOffset = -topSpace + edgeMargin
-    } else if bubbleOffset > 0 && bottomSpace < bubbleOffset {
-      bubbleOffset = bottomSpace - edgeMargin
+    if constrainInContainerView {
+      let topSpace = frame.origin.y - containerView.frame.origin.y
+      let bottomSpace = containerView.frame.height - topSpace - frame.height
+      
+      if bubbleOffset < 0 && topSpace < abs(bubbleOffset) {
+        bubbleOffset = -topSpace + edgeMargin
+      } else if bubbleOffset > 0 && bottomSpace < bubbleOffset {
+        bubbleOffset = bottomSpace - edgeMargin
+      }
     }
     
     frame.origin.y += bubbleOffset

  
  /// Checks if the rect with positioning `.none` is inside the container
  internal func rectContained(rect: CGRect) -> CGRect {
    guard let containerView = containerView else { return .zero }
    
    var finalRect = rect
    

      bubbleOffset = -(arrowSize.width + edgeMargin)
    }
    
    if constrainInContainerView {
      // Make sure that the bubble doesn't leaves the boundaries of the view
      let leftSpace = frame.origin.x - containerView.frame.origin.x
      let rightSpace = containerView.frame.width - leftSpace - frame.width
      
      if bubbleOffset < 0 && leftSpace < abs(bubbleOffset) {
        bubbleOffset = -leftSpace + edgeMargin
      } else if bubbleOffset > 0 && rightSpace < bubbleOffset {
        bubbleOffset = rightSpace - edgeMargin
      }
    }
    frame.origin.x += bubbleOffset
    frame.size = CGSize(width: frame.width + borderWidth * 2, height: frame.height + borderWidth * 2)
    
