aboutsummaryrefslogtreecommitdiffstats
path: root/web/index.js
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-09-05 18:37:50 +0300
committerTulir Asokan <tulir@maunium.net>2020-09-05 18:37:50 +0300
commitde072dcd81de37e460e1c47906f377226fec436b (patch)
tree52c74f946cc12ce0b4c829e30110e5511fc2c6ed /web/index.js
parent6e6aad0430686189f155193e74db5bedad1bcca0 (diff)
Add hack to make scrolling work on iOS (ref #8)
Diffstat (limited to 'web/index.js')
-rw-r--r--web/index.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/index.js b/web/index.js
index 6e4451e..921c591 100644
--- a/web/index.js
+++ b/web/index.js
@@ -15,6 +15,9 @@ let HOMESERVER_URL = "https://matrix-client.matrix.org"
const makeThumbnailURL = mxc => `${HOMESERVER_URL}/_matrix/media/r0/thumbnail/${mxc.substr(6)}?height=128&width=128&method=scale`
+// We need to detect iOS webkit because it has a bug related to scrolling non-fixed divs
+const isMobileSafari = navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/)
+
class App extends Component {
constructor(props) {
super(props)
@@ -109,7 +112,7 @@ class App extends Component {
<nav>
${this.state.packs.map(pack => html`<${NavBarItem} id=${pack.id} pack=${pack}/>`)}
</nav>
- <div class="pack-list" ref=${elem => this.packListRef = elem}>
+ <div class="pack-list ${isMobileSafari ? "ios-safari-hack" : ""}" ref=${elem => this.packListRef = elem}>
${this.state.packs.map(pack => html`<${Pack} id=${pack.id} pack=${pack}/>`)}
</div>
</main>`
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage