Skip to content

Commit 806a5bb

Browse files
committed
chore(docs): Update docs to suggest using preventOverflow
Alternatively, we can also set preventOverflow to true by default if left or right are used, but it sounds like the team wants to avoid setting defaults like that.
1 parent fe63802 commit 806a5bb

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/react-core/src/components/Dropdown/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useOUIAProps, OUIAProps, onToggleArrowKeydownDefault } from '../../help
77
export interface DropdownPopperProps {
88
/** Vertical direction of the popper. If enableFlip is set to true, this will set the initial direction before the popper flips. */
99
direction?: 'up' | 'down';
10-
/** Horizontal position of the popper */
10+
/** Horizontal position of the popper. If "left" or "right" are used on a dropdown near the edge of a page/container, you likely also want to enable the prop preventOverflow to prevent clipping. */
1111
position?: 'right' | 'left' | 'center' | 'start' | 'end';
1212
/** Custom width of the popper. If the value is "trigger", it will set the width to the dropdown toggle's width */
1313
width?: string | 'trigger';

packages/react-core/src/components/Menu/MenuContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { onToggleArrowKeydownDefault, Popper } from '../../helpers';
44
export interface MenuPopperProps {
55
/** Vertical direction of the popper. If enableFlip is set to true, this will set the initial direction before the popper flips. */
66
direction?: 'up' | 'down';
7-
/** Horizontal position of the popper */
7+
/** Horizontal position of the popper. If "left" or "right" are used on a menu near the edge of a page/container, you likely also want to enable the prop preventOverflow to prevent clipping. */
88
position?: 'right' | 'left' | 'center' | 'start' | 'end';
99
/** Custom width of the popper. If the value is "trigger", it will set the width to the dropdown toggle's width */
1010
width?: string | 'trigger';

packages/react-core/src/components/Select/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getOUIAProps, OUIAProps, getDefaultOUIAId, onToggleArrowKeydownDefault
77
export interface SelectPopperProps {
88
/** Vertical direction of the popper. If enableFlip is set to true, this will set the initial direction before the popper flips. */
99
direction?: 'up' | 'down';
10-
/** Horizontal position of the popper */
10+
/** Horizontal position of the popper. If "left" or "right" are used on a select near the edge of a page/container, you likely also want to enable the prop preventOverflow to prevent clipping. */
1111
position?: 'right' | 'left' | 'center' | 'start' | 'end';
1212
/** Custom width of the popper. If the value is "trigger", it will set the width to the select toggle's width */
1313
width?: string | 'trigger';

packages/react-core/src/helpers/Popper/Popper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface PopperProps {
6767
popperRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;
6868
/** popper direction */
6969
direction?: 'up' | 'down';
70-
/** popper position */
70+
/** Horizontal position of the popper. Use the additional prop preventOverflow if seeing clipping. */
7171
position?: 'right' | 'left' | 'center' | 'start' | 'end';
7272
/** Instead of direction and position can set the placement of the popper */
7373
placement?: Placement;
@@ -217,7 +217,7 @@ export const Popper: React.FunctionComponent<PopperProps> = ({
217217
onMount = () => {},
218218
onShow = () => {},
219219
onShown = () => {},
220-
preventOverflow = false
220+
preventOverflow
221221
}) => {
222222
const [triggerElement, setTriggerElement] = useState(null);
223223
const [refElement, setRefElement] = useState<HTMLElement>(null);

0 commit comments

Comments
 (0)