Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
footer: null as React.ReactNode,
isPlain: false,
isText: false,
isFlipEnabled: false,
isFlipEnabled: true,
removeFindDomNode: false
};
constructor(props: ContextSelectorProps) {
Expand Down Expand Up @@ -145,15 +145,10 @@ export class ContextSelector extends React.Component<ContextSelectorProps, { oui
const uniqueId = id || getUniqueId();
const toggleId = `pf-context-selector-toggle-id-${uniqueId}`;
const screenReaderLabelId = `pf-context-selector-label-id-${uniqueId}`;
const isStatic = isFlipEnabled && menuAppendTo !== 'inline';

const menuContainer = (
<div
className={css(styles.contextSelectorMenu)}
// This removes the `position: absolute`styling from the `.pf-c-context-selector__menu`
// allowing the menu to flip correctly
{...(isFlipEnabled && { style: { position: 'revert' } })}
id={uniqueId}
>
<div className={css(styles.contextSelectorMenu, isStatic && styles.modifiers.static)} id={uniqueId}>
{isOpen && (
<FocusTrap
active={!disableFocusTrap}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const Dropdown: React.FunctionComponent<DropdownProps> = ({
alignments,
contextProps,
menuAppendTo = 'inline',
isFlipEnabled = false,
isFlipEnabled = true,
removeFindDomNode = false,
...props
}: DropdownProps) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
onSelect: (): void => undefined,
autoFocus: true,
menuAppendTo: 'inline',
isFlipEnabled: false
isFlipEnabled: true
};

constructor(props: DropdownProps & OUIAProps) {
Expand Down Expand Up @@ -93,15 +93,14 @@ export class DropdownWithContext extends React.Component<DropdownProps & OUIAPro
renderedContent = React.Children.toArray(children);
}
const openedOnEnter = this.openedOnEnter;
const isStatic = isFlipEnabled && menuAppendTo !== 'inline';
return (
<DropdownContext.Consumer>
{({ baseClass, baseComponent, id: contextId, ouiaId, ouiaComponentType, ouiaSafe, alignments }) => {
const BaseComponent = baseComponent as any;
const menuContainer = (
<DropdownMenu
// This removes the `position: absolute` styling from the `.pf-c-dropdown__menu`
// allowing the menu to flip correctly
{...(isFlipEnabled && { style: { position: 'revert', minWidth: 'min-content' } })}
className={css(isStatic && styles.modifiers.static)}
setMenuComponentRef={this.setMenuComponentRef}
component={component}
isOpen={isOpen}
Expand Down
7 changes: 3 additions & 4 deletions packages/react-core/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
isInputFilterPersisted: false,
isCreateSelectOptionObject: false,
shouldResetOnSelect: true,
isFlipEnabled: false,
isFlipEnabled: true,
removeFindDomNode: false
};

Expand Down Expand Up @@ -1258,11 +1258,10 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
}
}

const isStatic = isFlipEnabled && menuAppendTo !== 'inline';
const innerMenu = (
<SelectMenu
// This removes the `position: absolute` styling from the `.pf-c-select__menu`
// allowing the menu to flip correctly
{...(isFlipEnabled && { style: { position: 'revert' } })}
className={css(isStatic && styles.modifiers.static)}
{...props}
isGrouped={isGrouped}
selected={selections}
Expand Down