@@ -163,6 +163,18 @@ export interface EuiPopoverProps extends PropsWithChildren, CommonProps {
163163 * an `EuiPopover` in a scrollable container, `repositionOnScroll` should be `true`
164164 */
165165 repositionOnScroll ?: boolean ;
166+ /**
167+ * By default, popovers will attempt to position themselves along the initial
168+ * axis specified. If there is not enough room either vertically or horizontally
169+ * however, the popover will attempt to reposition itself along the secondary
170+ * cross axis if there is room there instead.
171+ *
172+ * If you do not not want this repositioning to occur (and it is acceptable for
173+ * the popover to appear offscreen), set this to false to disable this behavior.
174+ *
175+ * @default true
176+ */
177+ repositionToCrossAxis ?: boolean ;
166178 /**
167179 * Must be set to true if using `EuiDragDropContext` within a popover,
168180 * otherwise your nested drag & drop will have incorrect positioning
@@ -281,6 +293,7 @@ export class EuiPopover extends Component<Props, State> {
281293 static defaultProps : Partial < PropsWithDefaults > = {
282294 isOpen : false ,
283295 ownFocus : true ,
296+ repositionToCrossAxis : true ,
284297 anchorPosition : 'downCenter' ,
285298 panelPaddingSize : 'm' ,
286299 hasArrow : true ,
@@ -517,7 +530,7 @@ export class EuiPopover extends Component<Props, State> {
517530 arrowBuffer : 10 ,
518531 } ,
519532 returnBoundingBox : this . props . attachToAnchor ,
520- allowCrossAxis : ! this . props . attachToAnchor ,
533+ allowCrossAxis : this . props . repositionToCrossAxis ,
521534 buffer : this . props . buffer ,
522535 } ) ;
523536
@@ -607,6 +620,7 @@ export class EuiPopover extends Component<Props, State> {
607620 hasArrow,
608621 arrowChildren,
609622 repositionOnScroll,
623+ repositionToCrossAxis,
610624 hasDragDrop,
611625 zIndex,
612626 attachToAnchor,
0 commit comments