Comments (7)
We could try the same trick as in mastodon/mastodon#4282 (hide the top bar when the input has focus).
from pinafore.
It seems like on iOS anyway, the browser is able to intelligently hide the nav bar when the keyboard is open:
So this appears to be a Chrome on Android issue, at least as currently implemented.
Since Chrome on Android also changed the window height when the keyboard pops up, we could just use some CSS rules to hide the nav bar when the height is below a certain threshold.
from pinafore.
Some widths and heights in Chrome:
Nexus 5
- landscape, keyboard open: 592, 80
- landscape, keyboard closed: 592, 280
- portrait, keyboard open: 360, 263
- portrait, keyboard closed: 360, 512
OnePlus 5T
- landscape, keyboard open: 775, 146
- landscape, keyboard closed: 775, 332
- portrait, keyboard open: 412, 440
- portrait, keyboard closed: 412, 695
from pinafore.
I tried to make some progress on this (dbd6fab). But I ran into several problems:
- iOS Safari behaves differently from Android Firefox and Chrome, as described above. It autohides the nav (good) but doesn't report the height changes (bad)
- The transition animation looks jerky on Firefox, even with
transform: translate
- It's not possible to determine when the soft keyboard is open, so you have to infer using media queries
- It's not possible to use
(orientation: landscape)
or(orientation: portrait)
, because the definition of landscape/portrait changes when the keyboard opens and closes (since it's defined as the ratio between the width and the height)
I could try to solve these problems as in the Mastodon codebase by also listening for focus events on the textarea, but that just adds more moving parts, and I'm worried this is already getting complicated enough and very risky, since I don't own every device on the planet and thus can't anticipate what kind of screen/keyboard combinations there are out there. (Even different soft keyboards have different heights.)
I'm tempted to just call this wontfix. iOS Safari at least demonstrates that it's possible for browser vendors to fix this themselves.
from pinafore.
Also even on a Nexus 5 (just about the smallest Android device I can think of), and even when not installed as a PWA (i.e. the URL bar is there), the keyboard takes up space, but it's far from unusable:
from pinafore.
Closing as wontfix; I just think that the risk this introduces is not worth the payoff of gaining ~70px of extra height by hiding the nav bar. If there is a better solution I'm not aware of, please let me know.
from pinafore.
i think there was some JS behavior change or browser behavior change that fixed this on my device, it was a lot lot worse before
from pinafore.
Related Issues (20)
- Allow a faster method to close full-sized images HOT 1
- Opening and closing tooltips is not communicated to assistive technologies HOT 1
- Favourite instance icon HOT 2
- Hotkeys help popup isn't easily scrollable HOT 4
- "Open original page" menu item for a toot HOT 1
- pinafore.social shows 404: NOT_FOUND HOT 1
- Navigation bar boundary invisible in dark mode
- Alt text should allow more characters than 420 HOT 2
- Pointers to ActivityStreams and RSS feeds missing HOT 4
- Missing option to add or remove an account to/from lists HOT 1
- Improvements to followers/following list items HOT 1
- Direct messages incorrectly render in pitch black when the theme is set to Dark Grayscale
- dark color schemes have a white bottom in Firefox HOT 2
- Make clear when a post is part of a thread HOT 1
- Fork of Pinafore with many curation features HOT 1
- Follow request list doesn't maintain scroll position HOT 1
- Approve / reject follow request from profile HOT 1
- Show profile’s posts without boosts
- Bot account tag should be included in the timeline
- Switch Between Multiple Accounts on Single Instance?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinafore.