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

Small screen adjustments for mobile PWA usage #2184

Open
wants to merge 15 commits into
base: the-future
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make search bar usable
  • Loading branch information
logiczsniper committed Mar 4, 2023
commit e331e4e783e4683db042cbd1d7236842ad78827c
4 changes: 4 additions & 0 deletions app/components/search-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default Component.extend({
algolia: service(),
metrics: service(),
raven: service(),
tetherConstraints: [{
to: 'window',
pin: true
}],

init() {
this._super(...arguments);
Expand Down
20 changes: 20 additions & 0 deletions app/styles/layout/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@

.search--drop {
width: 350px;

@media (max-width: 452px) {
width: 300px;
}

max-height: 90vh;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes result in the searchbar being hidden by the results dropdown while typing on iOS (at least on my phone with the browser interface on the bottom). I'd suggest making this max height use the new dvh unit and have a fallback to vh.

max-height: 85vh; /* less likely to interfere with other stuff */
max-height: 90dvh;

background-color: $search-background-color;
overflow: auto;
Expand All @@ -339,6 +344,12 @@
.search--results {
padding: 5px 0;
.media {
@media (max-width: 550px) {
display: grid;
grid-template-columns: 62px 1fr min-content;
column-gap: 8px;
}

padding: 5px 10px;
&:hover {
background: $search-results-hover-background;
Expand All @@ -364,6 +375,15 @@
background-color: $search-header-background;
padding: 10px;
margin-bottom: 0px;
display: flex;
align-items: center;
justify-content: space-between;

.search-close {
border: none;
background-color: inherit;
color: $body-text-color;
}
}

.search--group-header {
Expand Down
6 changes: 5 additions & 1 deletion app/templates/components/search-results.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
attachment=(or attachment "top right")
targetAttachment=(or targetAttachment "bottom right")
offset=(or offset "-30px 0px")
constraints=tetherConstraints
}}
<div class="search--drop">
<p class="search--header">{{t "components.search.header"}}</p>
<p class="search--header">
{{t "components.search.header"}}
<button class="search-close" onclick={{action "close"}}>🞪</button>
</p>
<div style="overflow: auto">
{{! media group }}
{{search-results/group
Expand Down