Skip to content

Commit 9ca191e

Browse files
committed
fix(quick-tools): add visible close button to search when toggler is off
1 parent d2bd3a1 commit 9ca191e

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎src/components/quickTools/footer.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const SearchRow1 = ({ inputRef }) => (
4545
<RowItem id="search-prev" icon="arrow_back" action="search-prev" />
4646
<RowItem id="search-next" icon="arrow_forward" action="search-next" />
4747
<RowItem id="search-settings" icon="settings" action="search-settings" />
48+
<RowItem id="close" icon="clearclose" action="toggle" />
4849
</div>
4950
);
5051

‎src/components/quickTools/style.scss‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
@use '../../styles/mixins.scss';
22

33
#quick-tools {
4+
#search_row1 {
5+
[data-id="close"] {
6+
display: none;
7+
flex: 0 0 40px;
8+
}
9+
10+
&.inline-close [data-id="close"] {
11+
display: inline-flex;
12+
}
13+
}
14+
415
.icon.click:not([disabled]) {
516
@include mixins.active-icon;
617
transition: all 0.3s ease-in-out;

‎src/handlers/quickTools.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@ function toggleSearch() {
438438
activeSearchState = { className, content: $content, footerHeight };
439439

440440
$toggler.className = "floating icon clearclose";
441+
$searchRow1.classList.toggle(
442+
"inline-close",
443+
!appSettings.value.floatingButton || !$toggler.isConnected,
444+
);
441445
$footer.content = [$searchRow1, $searchRow2];
442446
clearSearchQuickToolsState($content);
443447
setRefValue($searchInput, selectedText || "");

0 commit comments

Comments
 (0)