Skip to content

Commit 9d2040f

Browse files
authored
Merge pull request #58 from react-component/fix-realign
fix: should re-align correctly when resize window, close: #56
2 parents ee78ba7 + 1b0e962 commit 9d2040f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ node_modules
2222
*.css
2323
build
2424
lib
25+
es
2526
coverage
2627
yarn.lock

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"build": "rc-tools run build",
3333
"gh-pages": "rc-tools run gh-pages",
3434
"start": "rc-tools run server",
35+
"compile": "rc-tools run compile",
3536
"pub": "rc-tools run pub --babel-runtime",
3637
"lint": "rc-tools run lint",
3738
"karma": "rc-test run karma",

src/Popup.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ class Popup extends Component {
2727

2828
onAlign = (popupDomNode, align) => {
2929
const props = this.props;
30-
const alignClassName = props.getClassNameFromAlign(props.align);
3130
const currentAlignClassName = props.getClassNameFromAlign(align);
32-
if (alignClassName !== currentAlignClassName) {
31+
// FIX: https://github.com/react-component/trigger/issues/56
32+
// FIX: https://github.com/react-component/tooltip/issues/79
33+
if (this.currentAlignClassName !== currentAlignClassName) {
3334
this.currentAlignClassName = currentAlignClassName;
3435
popupDomNode.className = this.getClassName(currentAlignClassName);
3536
}

0 commit comments

Comments
 (0)