Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probbably need to update overflown classname. #56

Closed
boba-keyost opened this issue Jun 2, 2017 · 3 comments
Closed

Probbably need to update overflown classname. #56

boba-keyost opened this issue Jun 2, 2017 · 3 comments
Assignees
Labels

Comments

@boba-keyost
Copy link

boba-keyost commented Jun 2, 2017

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);
}
@benjycui
Copy link
Member

ref: react-component/tooltip#79

@benjycui benjycui self-assigned this Jun 15, 2017
@benjycui benjycui added the bug label Jun 15, 2017
afc163 added a commit that referenced this issue Jun 15, 2017
fix: should re-align correctly when resize window, close: #56
@benjycui
Copy link
Member

1.11.2

@boba-keyost
Copy link
Author

Ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants