diff --git a/public/scripts/slash-commands/SlashCommandAutoComplete.js b/public/scripts/slash-commands/SlashCommandAutoComplete.js index 3ac3ae51f..9a238663b 100644 --- a/public/scripts/slash-commands/SlashCommandAutoComplete.js +++ b/public/scripts/slash-commands/SlashCommandAutoComplete.js @@ -501,11 +501,11 @@ export class SlashCommandAutoComplete { this.dom.style.setProperty('--bottom', `${window.innerHeight - rect.top}px`); this.domWrap.style.bottom = `${window.innerHeight - rect.top}px`; if (this.isShowingDetails) { - this.domWrap.style.left = '1vw'; + this.domWrap.style.setProperty('--leftOffset', '1vw'); } else { - this.domWrap.style.left = `${rect.left}px`; + this.domWrap.style.setProperty('--leftOffset', `${rect.left}px`); } - this.domWrap.style.right = `calc(1vw + ${this.isShowingDetails ? 25 : 0}vw)`; + this.domWrap.style.setProperty('--rightOffset', `calc(1vw + ${this.isShowingDetails ? 25 : 0}vw)`); this.updateDetailsPosition(); } } @@ -523,7 +523,7 @@ export class SlashCommandAutoComplete { const selRect = this.selectedItem.dom.children[0].getBoundingClientRect(); this.detailsWrap.style.setProperty('--targetOffset', `${selRect.top}`); this.detailsWrap.style.bottom = `${window.innerHeight - rect.top}px`; - this.detailsWrap.style.left = `calc(100vw - ${this.domWrap.style.right})`; + this.detailsWrap.style.left = `calc(100vw - calc(1vw + ${this.isShowingDetails ? 25 : 0}vw))`; this.detailsWrap.style.right = '1vw'; this.detailsWrap.style.top = '5vh'; } else { diff --git a/public/style.css b/public/style.css index 49d591aa6..6d0eabb82 100644 --- a/public/style.css +++ b/public/style.css @@ -1101,9 +1101,13 @@ select { .slashCommandAutoComplete-wrap { --targetOffset: 0; --direction: column; + --leftOffset: 1vw; + --rightOffset: 1vw; display: flex; flex-direction: var(--direction); position: absolute; + left: var(--leftOffset); + right: var(--rightOffset); z-index: 10000; @@ -1508,7 +1512,21 @@ select { } } } - +@media screen and (max-width: 1000px) { + .slashCommandAutoComplete-wrap { + left: 1vw; + > .slashCommandAutoComplete { + .specs { + grid-column: 2 / 4; + } + .help { + grid-column: 2 / 4; + padding-left: 1em; + opacity: 0.75; + } + } + } +} .slashCommandBrowser { > .search { display: flex;