FIX: tweaks of select-kit on mobile (#26401)
- uses footer-nav height and safe-area-inset-bottom as bottom padding - body scroll lock select-kit only when inside a modal
This commit is contained in:
parent
65c03af919
commit
88b9f0bc56
|
@ -916,6 +916,26 @@ export default Component.extend(
|
||||||
);
|
);
|
||||||
const strategy = this._computePlacementStrategy();
|
const strategy = this._computePlacementStrategy();
|
||||||
|
|
||||||
|
let bottomOffset = 0;
|
||||||
|
if (this.capabilities.isIOS) {
|
||||||
|
bottomOffset +=
|
||||||
|
parseInt(
|
||||||
|
getComputedStyle(document.documentElement)
|
||||||
|
.getPropertyValue("--safe-area-inset-bottom")
|
||||||
|
.trim(),
|
||||||
|
10
|
||||||
|
) || 0;
|
||||||
|
}
|
||||||
|
if (this.site.mobileView) {
|
||||||
|
bottomOffset +=
|
||||||
|
parseInt(
|
||||||
|
getComputedStyle(document.documentElement)
|
||||||
|
.getPropertyValue("--footer-nav-height")
|
||||||
|
.trim(),
|
||||||
|
10
|
||||||
|
) || 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.popper = createPopper(anchor, popper, {
|
this.popper = createPopper(anchor, popper, {
|
||||||
eventsEnabled: false,
|
eventsEnabled: false,
|
||||||
strategy,
|
strategy,
|
||||||
|
@ -940,6 +960,7 @@ export default Component.extend(
|
||||||
),
|
),
|
||||||
10
|
10
|
||||||
) || 0,
|
) || 0,
|
||||||
|
bottom: bottomOffset,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { cached } from "@glimmer/tracking";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import {
|
import {
|
||||||
|
@ -8,8 +9,18 @@ import {
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
|
|
||||||
|
@cached
|
||||||
|
get inModal() {
|
||||||
|
const element = this.selectKit.mainElement();
|
||||||
|
return element.closest(".d-modal");
|
||||||
|
},
|
||||||
|
|
||||||
@action
|
@action
|
||||||
lock(element) {
|
lock(element) {
|
||||||
|
if (!this.inModal) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
disableBodyScroll(element);
|
disableBodyScroll(element);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
--d-input-bg-color--disabled: var(--primary-low);
|
--d-input-bg-color--disabled: var(--primary-low);
|
||||||
--d-input-text-color--disabled: var(--primary);
|
--d-input-text-color--disabled: var(--primary);
|
||||||
--d-input-border--disabled: 1px solid var(--primary-low);
|
--d-input-border--disabled: 1px solid var(--primary-low);
|
||||||
|
--safe-area-inset-bottom: env(safe-area-inset-bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Animation Keyframes
|
// Animation Keyframes
|
||||||
|
|
Loading…
Reference in New Issue