Make moderation popover not exit confines of modal

thanks twinkle
it's not a solution i'm proud of and ideally it would behave fine but i think
i've just reached a limitation of css here

grumble grumble
This commit is contained in:
Sol Fisher Romanoff 2022-12-12 22:23:31 +02:00
parent d09cfe76db
commit a4173e0900
Signed by: nbsp
GPG Key ID: 9D3F2B64F2341B62
3 changed files with 15 additions and 2 deletions

View File

@ -36,6 +36,11 @@
.user-moderation {
padding-top: 0.6em;
position: relative;
.popover {
right: 0;
}
}
.basic-user-card {

View File

@ -5,6 +5,7 @@
class="moderation-tools-popover"
placement="bottom"
:offset="{ y: 5 }"
:noCenter="extended"
@show="setToggled(true)"
@close="setToggled(false)"
>

View File

@ -31,7 +31,11 @@ const Popover = {
// If true, subtract padding when calculating position for the popover,
// use it when popover offset looks to be different on top vs bottom.
removePadding: Boolean
removePadding: Boolean,
// If true, do not center the popover under the button that called it,
// instead aligning it to the right.
noCenter: Boolean
},
data () {
return {
@ -121,7 +125,10 @@ const Popover = {
: yOffset
const xOffset = (this.offset && this.offset.x) || 0
const translateX = anchorWidth * 0.5 - content.offsetWidth * 0.5 + horizOffset + xOffset
let translateX = translateX = anchorWidth * 0.5 - content.offsetWidth * 0.5 + horizOffset + xOffset
if (this.noCenter) {
translateX = 0
}
// Note, separate translateX and translateY avoids blurry text on chromium,
// single translate or translate3d resulted in blurry text.