Skip to content

Commit

Permalink
fix(ios): can't scroll when search results overflow with soft keyboar…
Browse files Browse the repository at this point in the history
…d opened
  • Loading branch information
xyhp915 authored and tiensonqin committed Dec 19, 2022
1 parent 7cb8d61 commit ef06aed
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--ls-left-sidebar-width: 246px;
--ls-left-sidebar-sm-width: 74vw;
--ls-left-sidebar-nav-btn-size: 38px;
--ls-native-kb-height: 0px;
--ls-error-color: var(--color-red-500);
--ls-warning-color: var(--color-orange-500);
--ls-success-color: var(--color-green-500);
Expand Down
14 changes: 14 additions & 0 deletions src/main/frontend/components/command_palette.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,22 @@
}

html.is-ios {
.ui__model {
&[label="ls-modal-search"] {
.panel-content {
padding-bottom: 0;
max-height: unset;
}
}

.ls-search {
@apply pb-0;
}
}

.cp__palette-main {
margin-bottom: 0;
--palettle-container-height: calc(98vh - 8rem - var(--ls-native-kb-height));
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/main/frontend/components/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
padding-right: 12px;
}

.ls-search {
@apply flex flex-col overflow-auto;

> .search-results-wrap {
@apply flex-1 overflow-auto h-full;
}
}

.search-item svg {
transform: scale(0.8);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/frontend/handler/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@
(when (mobile-util/native-ios?)
(reset! util/keyboard-height keyboard-height)
(set! (.. main-node -style -marginBottom) (str keyboard-height "px"))
(when-let [^js html (js/document.querySelector ":root")]
(.setProperty (.-style html) "--ls-native-kb-height" (str keyboard-height "px")))
(when-let [left-sidebar-node (gdom/getElement "left-sidebar")]
(set! (.. left-sidebar-node -style -bottom) (str keyboard-height "px")))
(when-let [right-sidebar-node (gdom/getElementByClass "sidebar-item-list")]
Expand All @@ -482,6 +484,8 @@
(when (= (state/sub :editor/record-status) "RECORDING")
(state/set-state! :mobile/show-recording-bar? false))
(when (mobile-util/native-ios?)
(when-let [^js html (js/document.querySelector ":root")]
(.removeProperty (.-style html) "--ls-native-kb-height"))
(when-let [card-preview-el (js/document.querySelector ".cards-review")]
(set! (.. card-preview-el -style -marginBottom) "0px"))
(when-let [card-preview-el (js/document.querySelector ".encryption-password")]
Expand Down

0 comments on commit ef06aed

Please sign in to comment.