From f555bba9e906327dd4e0414c614e46df77ff673e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Sun, 7 Feb 2021 00:10:02 +0100 Subject: [PATCH] Fix mobile issues with searchbox and nav menu (#72) * Fix mobile Safari searchbox style (#62) * Fix mobile menu not closing on outside click (#62) --- .../components/SearchAutoComplete.svelte | 7 ++- bookmarks/styles/bookmarks.scss | 26 ++++++++-- bookmarks/styles/shared.scss | 1 - bookmarks/templates/bookmarks/index.html | 4 +- bookmarks/templates/bookmarks/layout.html | 35 ++----------- bookmarks/templates/bookmarks/nav_menu.html | 49 +++++++++++++++++++ 6 files changed, 82 insertions(+), 40 deletions(-) create mode 100644 bookmarks/templates/bookmarks/nav_menu.html diff --git a/bookmarks/components/SearchAutoComplete.svelte b/bookmarks/components/SearchAutoComplete.svelte index a911b88..130c7c9 100644 --- a/bookmarks/components/SearchAutoComplete.svelte +++ b/bookmarks/components/SearchAutoComplete.svelte @@ -189,8 +189,8 @@
-
- +
@@ -257,6 +257,9 @@ .form-autocomplete-input { padding: 0; } + .form-autocomplete-input.is-focused { + z-index: 2; + } /* TODO: Should be read from theme */ .menu-item.selected > a { diff --git a/bookmarks/styles/bookmarks.scss b/bookmarks/styles/bookmarks.scss index 7c03403..feb1fb7 100644 --- a/bookmarks/styles/bookmarks.scss +++ b/bookmarks/styles/bookmarks.scss @@ -1,13 +1,33 @@ -.bookmarks-page { +.bookmarks-page .search { + $searchbox-height: 1.8rem; - .search input[type=search] { + // Regular input + input[type='search'] { width: 180px; - height: 1.8rem; + height: $searchbox-height; + -webkit-appearance: none; @media (min-width: $control-width-md) { width: 300px; } } + + // Enhanced auto-complete input + // This needs a bit more wrangling to make the CSS component align with the attached button + .form-autocomplete { + height: $searchbox-height; + + .form-autocomplete-input { + height: $searchbox-height; + width: 100%; + + input[type='search'] { + height: 100%; + margin: 0; + border: none; + } + } + } } ul.bookmark-list { diff --git a/bookmarks/styles/shared.scss b/bookmarks/styles/shared.scss index 59c3349..62d03cc 100644 --- a/bookmarks/styles/shared.scss +++ b/bookmarks/styles/shared.scss @@ -4,7 +4,6 @@ section.content-area { border-bottom: solid 1px $border-color; display: flex; flex-direction: row; - align-items: baseline; margin-bottom: 16px; h2 { diff --git a/bookmarks/templates/bookmarks/index.html b/bookmarks/templates/bookmarks/index.html index ebd71a3..8c0ff03 100644 --- a/bookmarks/templates/bookmarks/index.html +++ b/bookmarks/templates/bookmarks/index.html @@ -12,10 +12,10 @@

Bookmarks