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 @@ -130,14 +130,13 @@ export function getMenuPlacement({
130
130
if ( placement === 'auto' || isFixedPosition ) {
131
131
// may need to be constrained after flipping
132
132
let constrainedHeight = maxHeight ;
133
+ const spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove ;
133
134
134
- if (
135
- ( ! isFixedPosition && scrollSpaceAbove >= minHeight ) ||
136
- ( isFixedPosition && viewSpaceAbove >= minHeight )
137
- ) {
138
- constrainedHeight = isFixedPosition
139
- ? viewSpaceAbove - marginBottom - spacing . controlHeight
140
- : scrollSpaceAbove - marginBottom - spacing . controlHeight ;
135
+ if ( spaceAbove >= minHeight ) {
136
+ constrainedHeight = Math . min (
137
+ spaceAbove - marginBottom - spacing . controlHeight ,
138
+ maxHeight
139
+ ) ;
141
140
}
142
141
143
142
return { placement : 'top' , maxHeight : constrainedHeight } ;
You can’t perform that action at this time.
0 commit comments