Skip to content

Commit

Permalink
fix: should re-align correctly when resize window, close: #56
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Jun 15, 2017
1 parent ee78ba7 commit 1b0e962
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ node_modules
*.css
build
lib
es
coverage
yarn.lock
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"build": "rc-tools run build",
"gh-pages": "rc-tools run gh-pages",
"start": "rc-tools run server",
"compile": "rc-tools run compile",
"pub": "rc-tools run pub --babel-runtime",
"lint": "rc-tools run lint",
"karma": "rc-test run karma",
Expand Down
5 changes: 3 additions & 2 deletions src/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class Popup extends Component {

onAlign = (popupDomNode, align) => {
const props = this.props;
const alignClassName = props.getClassNameFromAlign(props.align);
const currentAlignClassName = props.getClassNameFromAlign(align);
if (alignClassName !== currentAlignClassName) {
// FIX: https://github.com/react-component/trigger/issues/56
// FIX: https://github.com/react-component/tooltip/issues/79
if (this.currentAlignClassName !== currentAlignClassName) {
this.currentAlignClassName = currentAlignClassName;
popupDomNode.className = this.getClassName(currentAlignClassName);
}
Expand Down

0 comments on commit 1b0e962

Please sign in to comment.