Commit 29cefc2 1 parent 87b4dc2 commit 29cefc2 Copy full SHA for 29cefc2
File tree 1 file changed +5
-1
lines changed
packages/amis-core/src/utils
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ export function calculatePosition(
169
169
: overlayHeight / 2 ;
170
170
171
171
// 如果还有其他可选项,则做位置判断,是否在可视区域,不完全在则继续看其他定位情况。
172
- if ( tests . length ) {
172
+ if ( tests . length || isAuto ) {
173
173
const transformed = {
174
174
x : clip . x + positionLeft / scaleX ,
175
175
y : clip . y + positionTop / scaleY ,
@@ -200,6 +200,10 @@ export function calculatePosition(
200
200
201
201
if ( visibleX && visibleY ) {
202
202
break ;
203
+ } else if ( isAuto && tests . length === 0 ) {
204
+ // 如果是 auto 模式,且最后一个方向都不可见,则直接平移到可见区域
205
+ visibleY || ( positionTop = window . innerHeight - transformed . height ) ;
206
+ visibleX || ( positionLeft = window . innerWidth - transformed . width ) ;
203
207
}
204
208
}
205
209
}
You can’t perform that action at this time.
0 commit comments