1
0
Fork 0
mirror of synced 2024-08-31 17:51:11 +12:00

Add max height to popover when rendering above anchor (#9945)

This commit is contained in:
Andrew Kingston 2023-03-08 15:50:15 +00:00 committed by GitHub
parent 3328a9524e
commit 04fc1be3d2

View file

@ -31,6 +31,7 @@ export default function positionDropdown(element, opts) {
styles.top = anchorBounds.top styles.top = anchorBounds.top
} else if (window.innerHeight - anchorBounds.bottom < 100) { } else if (window.innerHeight - anchorBounds.bottom < 100) {
styles.top = anchorBounds.top - elementBounds.height - offset styles.top = anchorBounds.top - elementBounds.height - offset
styles.maxHeight = 240
} else { } else {
styles.top = anchorBounds.bottom + offset styles.top = anchorBounds.bottom + offset
styles.maxHeight = window.innerHeight - anchorBounds.bottom - 20 styles.maxHeight = window.innerHeight - anchorBounds.bottom - 20