fix: PR comments
This commit is contained in:
parent
4c3834828a
commit
afcf7d793a
|
|
@ -232,12 +232,6 @@ const StyledMultiDropDown = styled(MultiDropDown)<{
|
|||
class DropDownComponent extends React.Component<DropDownComponentProps> {
|
||||
private _menu = React.createRef<HTMLDivElement>();
|
||||
|
||||
isModalWidgetParent = () => {
|
||||
if (Boolean(this._menu.current?.closest(".bp3-modal-widget"))) {
|
||||
return document.querySelector(".bp3-modal-widget") as HTMLElement;
|
||||
}
|
||||
return document.querySelector(".appsmith_widget_0") as HTMLElement;
|
||||
};
|
||||
render() {
|
||||
const { options, selectedIndexArr } = this.props;
|
||||
const selectedItems = selectedIndexArr
|
||||
|
|
@ -307,7 +301,9 @@ class DropDownComponent extends React.Component<DropDownComponentProps> {
|
|||
popoverProps={{
|
||||
minimal: true,
|
||||
usePortal: true,
|
||||
portalContainer: this.isModalWidgetParent(),
|
||||
portalContainer: this.props.getDropdownPosition(
|
||||
this._menu.current,
|
||||
),
|
||||
modifiers: {
|
||||
preventOverflow: {
|
||||
enabled: false,
|
||||
|
|
@ -434,6 +430,7 @@ export interface DropDownComponentProps extends ComponentProps {
|
|||
isFilterable: boolean;
|
||||
width: number;
|
||||
height: number;
|
||||
getDropdownPosition: (node: HTMLDivElement | null) => HTMLElement;
|
||||
}
|
||||
|
||||
export default DropDownComponent;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ export function ModalComponent(props: ModalComponentProps) {
|
|||
modalContentRef.current?.scrollTo({ top: 0, behavior: "smooth" });
|
||||
}
|
||||
}, [props.scrollContents]);
|
||||
console.log(props.height, props.width, props.left, props.top);
|
||||
return (
|
||||
<Overlay
|
||||
canEscapeKeyClose={false}
|
||||
|
|
@ -85,9 +84,6 @@ export function ModalComponent(props: ModalComponentProps) {
|
|||
isOpen={props.isOpen}
|
||||
onClose={props.onClose}
|
||||
portalClassName="bp3-modal-widget"
|
||||
portalContainer={
|
||||
document.querySelector(".t--canvas-artboard") as HTMLElement
|
||||
}
|
||||
usePortal
|
||||
>
|
||||
<Container
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
|||
? this.props.selectedOptionValueArr
|
||||
: [];
|
||||
}
|
||||
getDropdownPosition = (node: HTMLDivElement | null) => {
|
||||
if (Boolean(node?.closest(".bp3-modal-widget"))) {
|
||||
return document.querySelector(".bp3-modal-widget") as HTMLElement;
|
||||
}
|
||||
return document.querySelector(".appsmith_widget_0") as HTMLElement;
|
||||
};
|
||||
|
||||
getPageView() {
|
||||
const options = this.props.options || [];
|
||||
|
|
@ -158,6 +164,7 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
|||
return (
|
||||
<DropDownComponent
|
||||
disabled={this.props.isDisabled}
|
||||
getDropdownPosition={this.getDropdownPosition}
|
||||
height={componentHeight}
|
||||
isFilterable={this.props.isFilterable}
|
||||
isLoading={this.props.isLoading}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user