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

    var y = from.origin.y + from.height / 2 - frame.height / 2
    
    if y < 0 { y = edgeMargin }
    //Make sure we stay in the view limits except if it has scroll then it must be inside contentview limits not the view
    if let containerScrollView = containerView as? UIScrollView {
        if y + frame.height > containerScrollView.contentSize.height {
            y = containerScrollView.contentSize.height - frame.height - edgeMargin

    frame.size = CGSize(width: textBounds.width + padding * 2 + edgeInsets.horizontal, height: textBounds.height + padding * 2 + edgeInsets.vertical + arrowSize.height)
    var x = from.origin.x + from.width / 2 - frame.width / 2
    if x < 0 { x = edgeMargin }
    if constrainInContainerView && (x + frame.width > containerView.bounds.width) { x = containerView.bounds.width - frame.width - edgeMargin }
    
    if direction == .down {
      frame.origin = CGPoint(x: x, y: from.origin.y + from.height + offset)
