     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 (x + frame.width > containerView.bounds.width) { x = containerView.bounds.width - frame.width - 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)

  @objc open dynamic var maskColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6)
  /// Flag to enable or disable background mask
  @objc open dynamic var shouldShowMask = false
  /// Holds the CGrect with the rect the tip is pointing to
  open var from = CGRect.zero {
    didSet {

      bubbleOffset = -(arrowPosition.y - arrowSize.height)
    }
    
    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
