Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/main/frontend/components/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/main/frontend/components/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
}

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

Expand Down