FIX: flips popper when top position is chosen incorrectly (#16333)

More precisely, if popper can't position something at the bottom, it will automatically attempt to position it at the top. However we should ensure it doesn’t consider the space under the d-header as valid space, when header's height is taken into consideration if top space is not enough, we should force bottom, and flip it back.

This logic is not necessary on modals as the d-header is not present.
This commit is contained in:
Joffrey JAFFEUX 2022-03-31 02:58:22 +02:00 committed by GitHub
parent 8999de6e5b
commit 57b20393ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -870,6 +870,21 @@ export default Component.extend(
strategy,
placement: this.selectKit.options.placement,
modifiers: [
{
name: "flip",
enabled: !inModal,
options: {
padding: {
top:
parseInt(
document.documentElement.style.getPropertyValue(
"--header-offset"
),
10
) || 0,
},
},
},
{
name: "offset",
options: {