Skip to content

Probbably need to update overflown classname. #56

@boba-keyost

Description

@boba-keyost

If Popup has placement with overflow options, it changes className once to overflown, but does'nt switch back if overflownot needed.
E.G. : We have rc-select dropdown menu with 'bottomLeft' placement. If there is no place on screen popup className would be set to topLeft.

In onAlign function you only check if alignClassName !== currentAlignClassName, but I guess, you should also check if this.currentAlignClassName !== currentAlignClassName

onAlign = (popupDomNode, align) => {
    const props = this.props;
    const alignClassName = props.getClassNameFromAlign(props.align);
    const currentAlignClassName = props.getClassNameFromAlign(align);
    if (alignClassName !== currentAlignClassName) {
      this.currentAlignClassName = currentAlignClassName;
      popupDomNode.className = this.getClassName(currentAlignClassName);
    }
    props.onAlign(popupDomNode, align);
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions