Skip to content

Commit 17aba21

Browse files
authored
fix: should update placment className when change align (#279)
ant-design/ant-design#31717
1 parent 55ed22f commit 17aba21

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Popup/PopupInner.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ const PopupInner = React.forwardRef<PopupInnerRef, PopupInnerProps>(
117117
}
118118

119119
function onInternalAlign(popupDomNode: HTMLElement, matchAlign: AlignType) {
120-
if (status === 'align') {
121-
const nextAlignedClassName = getClassNameFromAlign(matchAlign);
120+
const nextAlignedClassName = getClassNameFromAlign(matchAlign);
121+
if (alignedClassName !== nextAlignedClassName) {
122122
setAlignedClassName(nextAlignedClassName);
123-
123+
}
124+
if (status === 'align') {
124125
// Repeat until not more align needed
125126
if (alignedClassName !== nextAlignedClassName) {
126127
Promise.resolve().then(() => {

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"esModuleInterop": true,
1010
"paths": {
1111
"@/*": ["src/*"],
12-
"@@/*": ["src/.umi/*"]
12+
"@@/*": ["src/.umi/*"],
13+
"rc-trigger": ["src/index.ts"]
1314
}
1415
}
1516
}

0 commit comments

Comments
 (0)