File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -131,14 +131,13 @@ export function getMenuPlacement({
131
131
if ( placement === 'auto' || isFixedPosition ) {
132
132
// may need to be constrained after flipping
133
133
let constrainedHeight = maxHeight ;
134
+ const spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove ;
134
135
135
- if (
136
- ( ! isFixedPosition && scrollSpaceAbove >= minHeight ) ||
137
- ( isFixedPosition && viewSpaceAbove >= minHeight )
138
- ) {
139
- constrainedHeight = isFixedPosition
140
- ? viewSpaceAbove - marginBottom - spacing . controlHeight
141
- : scrollSpaceAbove - marginBottom - spacing . controlHeight ;
136
+ if ( spaceAbove >= minHeight ) {
137
+ constrainedHeight = Math . min (
138
+ spaceAbove - marginBottom - spacing . controlHeight ,
139
+ maxHeight
140
+ ) ;
142
141
}
143
142
144
143
return { placement : 'top' , maxHeight : constrainedHeight } ;
You can’t perform that action at this time.
0 commit comments