mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
fix: modal shift on close + readd settings preload (#6448)
* fix: NewModal layout shift on close * fix: preload queries in settings modals * fix: any
This commit is contained in:
@@ -268,6 +268,7 @@ function hide() {
|
||||
return
|
||||
}
|
||||
props.onHide?.()
|
||||
resetMousePosition()
|
||||
visible.value = false
|
||||
popModal()
|
||||
if (modalStackSize() === 0) {
|
||||
@@ -309,6 +310,11 @@ function updateMousePosition(event: { clientX: number; clientY: number }) {
|
||||
mouseY.value = event.clientY
|
||||
}
|
||||
|
||||
function resetMousePosition() {
|
||||
mouseX.value = Math.round(window.innerWidth / 2)
|
||||
mouseY.value = Math.round(window.innerHeight / 2)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (open.value) {
|
||||
popModal()
|
||||
@@ -325,8 +331,6 @@ function handleWindowKeyDown(event: KeyboardEvent) {
|
||||
if (props.closeOnEsc && event.key === 'Escape' && props.closable) {
|
||||
if (!isTopmostModal()) return
|
||||
hide()
|
||||
mouseX.value = Math.round(window.innerWidth / 2)
|
||||
mouseY.value = Math.round(window.innerHeight / 2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user