File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -240,11 +240,18 @@ export default function useAlign(
240240 const overflow = placementInfo . overflow || { } ;
241241 const { adjustX, adjustY, shiftX, shiftY } = overflow ;
242242
243+ const supportAdjust = ( val : boolean | number ) => {
244+ if ( typeof val === 'boolean' ) {
245+ return val ;
246+ }
247+ return val >= 0 ;
248+ } ;
249+
243250 // >>>>>>>>>> Top & Bottom
244251 const nextPopupY = popupRect . y + nextOffsetY ;
245252 const nextPopupBottom = nextPopupY + popupHeight ;
246253
247- const needAdjustY = adjustY === true || adjustY >= 0 ;
254+ const needAdjustY = supportAdjust ( adjustY ) ;
248255
249256 // Bottom to Top
250257 if (
@@ -278,7 +285,7 @@ export default function useAlign(
278285 const nextPopupX = popupRect . x + nextOffsetX ;
279286 const nextPopupRight = nextPopupX + popupWidth ;
280287
281- const needAdjustX = adjustX === true || adjustX >= 0 ;
288+ const needAdjustX = supportAdjust ( adjustX ) ;
282289
283290 // >>>>> Flip
284291 // Right to Left
You can’t perform that action at this time.
0 commit comments