fix(ui): incorrect position of absolute modal on some mobile platforms

pull/8829/head^2
charlie 2023-03-15 11:59:51 +08:00 committed by Tienson Qin
parent ac4e2a1b48
commit 988a00e266
2 changed files with 7 additions and 7 deletions

View File

@ -392,11 +392,9 @@
:z-index 11}
(when set-default-width?
{:width max-width})
(when-let [^js/HTMLElement editor
(js/document.querySelector ".editor-wrapper")]
(if (<= (.-clientWidth editor) (+ left (if set-default-width? max-width 500)))
{:right 0}
{:left (if (or (nil? y-diff) (and y-diff (= y-diff 0))) left 0)})))]
(if (<= vw-max-width (+ left (if set-default-width? max-width 500)))
{:right 0}
{:left (if (or (nil? y-diff) (and y-diff (= y-diff 0))) left 0)}))]
[:div.absolute.rounded-md.shadow-lg.absolute-modal
{:ref *el
:data-modal-name modal-name

View File

@ -42,8 +42,10 @@
}
&[data-modal-name="commands"] {
width: 380px !important;
max-width: 90vw !important;
@screen sm {
width: 380px !important;
max-width: 90vw !important;
}
}
}