Fix popup position (#210)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2021-09-22 17:06:09 +03:00 committed by GitHub
parent 7733f44e11
commit e6715a1970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,6 @@
-->
<script lang="ts">
import Component from './Component.svelte'
import type { AnySvelteComponent, AnyComponent, PopupAlignment } from '../types'
import { closePopup } from '..'
@ -57,7 +56,7 @@ $: {
}
if (rect.left + rectPopup.width + 16 > document.body.clientWidth) {
modalHTML.style.left = ''
modalHTML.style.right = '1rem'
modalHTML.style.right = document.body.clientWidth - rect.right + 'px'
} else {
modalHTML.style.left = rect.left + 'px'
modalHTML.style.right = ''