hackmdio / hackmdio/codimd

Android virtual keyboard hides navbar for ever

Open
#1,589 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.1k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I cannot use CodiMD on Android devices.
The navbar is hidden when I focus the editor, and it never comes back when I finished the keyboard.
I guess that, Android doesn't fire the onBlur event on hiding its virtual keyboard.

```
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -263,7 +263,8 @@ let visibleXS = false
let visibleSM = false
let visibleMD = false
let visibleLG = false
-const isTouchDevice = 'ontouchstart' in document.documentElement
+const isTouchDevice = 'ontouchstart' in document.documentElement &&
+ /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent) && !window.MSStream
let currentStatus = statusType.offline
const lastInfo = {
needRestore: false,
```

If you really want to detect Android keyboard, you should watch onResize instead of focus/blur.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.