diff --git a/uui-components/src/overlays/Dropdown.tsx b/uui-components/src/overlays/Dropdown.tsx index 33694e7e49..aa04feedc7 100644 --- a/uui-components/src/overlays/Dropdown.tsx +++ b/uui-components/src/overlays/Dropdown.tsx @@ -41,6 +41,8 @@ export interface DropdownProps extends Partial> { portalTarget?: HTMLElement; boundaryElement?: Boundary; + + closeBodyOnTogglerHidden?: boolean; // default: true; Set false if you do not want to hide the dropdown body in case Toggler is out of the viewport } export class Dropdown extends React.Component { @@ -191,7 +193,7 @@ export class Dropdown extends React.Component { } }; - if (isReferenceHidden && (this.state.opened || this.props.value)) { + if (isReferenceHidden && this.props.closeBodyOnTogglerHidden !== false && (this.state.opened || this.props.value)) { // Yes, we know that it's hack and we can perform setState in render, but we don't have other way to do it in this case setTimeout(() => { this.handleOpenedChange(false); }, 0); return null; diff --git a/uui-components/src/pickers/PickerInputBase.tsx b/uui-components/src/pickers/PickerInputBase.tsx index 6aa83b607b..cdfbe5bbe9 100644 --- a/uui-components/src/pickers/PickerInputBase.tsx +++ b/uui-components/src/pickers/PickerInputBase.tsx @@ -281,6 +281,7 @@ export abstract class PickerInputBase extends PickerBase ); }