Skip to content

Open source personal finance application

update layout to fix iPhone height

ilkomece595c095b31
diff --git a/components/layout/LayoutMobile.vue b/components/layout/LayoutMobile.vue
index 3637cfa0..21a04cbf 100644
--- a/components/layout/LayoutMobile.vue
+++ b/components/layout/LayoutMobile.vue
@@ -930,6 +930,7 @@ export default {
border-radius $m6
.layoutMobile
+ flex-grow 1
display grid
height 100%
padding-bottom 44px
diff --git a/layouts/default.vue b/layouts/default.vue
index 0a103317..172b053b 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -6,7 +6,7 @@ import isTouchDevice from '~/assets/js/isTouchDevice'
export default {
name: 'DefaultLayout',
- setup (props, ctx) {
+ setup () {
const isShowUpdateApp = ref(false)
onMounted(async () => {
@@ -30,22 +30,17 @@ export default {
}
},
- computed: {
- layoutStyles () {
- return { height: `${this.$store.state.ui.height}px` }
- }
- },
-
mounted () {
- this.isTouchDevice = isTouchDevice()
this.getPageDimensions()
- window.addEventListener('resize', debounce(this.getPageDimensions, 600))
+ this.isTouchDevice = isTouchDevice()
+ window.addEventListener('resize', debounce(this.getPageDimensions, 300))
},
methods: {
getPageDimensions () {
const width = document.documentElement.clientWidth
const height = document.documentElement.clientHeight
+ document.documentElement.style.setProperty('--height', height + 'px')
this.$store.dispatch('ui/setAppDimensions', { width, height })
}
}
@@ -53,9 +48,8 @@ export default {
</script>
<template lang="pug">
-.finapp(
- :class="{ isNotTouchDevice: !isTouchDevice }"
- :style="layoutStyles"
+.layout(
+ :class="{ isNotTouchDevice: !isTouchDevice, isTouchDevice: isTouchDevice }"
)
//- Loading
template(v-if="!$store.state.app.status.ready")
@@ -85,6 +79,12 @@ export default {
)
</template>
+<style lang="css">
+:root {
+ --height: 100vh
+}
+</style>
+
<style lang="stylus">
@import '~assets/stylus/variables'
@@ -95,13 +95,19 @@ export default {
&:focus
outline 0
+html
+body
+#__nuxt
+#__layout
+ height 100%
+
html
font-size 16px
-// overscroll-behavior-y contain
+ overscroll-behavior-y contain
body
overflow hidden
- // overscroll-behavior-y contain
+ overscroll-behavior-y contain
margin 0
color var(--c-font-2)
font-primary()
@@ -110,15 +116,13 @@ body
letter-spacing 0
background var(--color-bg-canvas)
user-select none
-</style>
-
-<style lang="stylus" scoped>
-@import '~assets/stylus/index'
-.finapp
+.layout
display flex
- flex-flow column
- min-height 100vh
+ height 100%
min-width 320px
- anim()
+
+ &__wrap
+ flex-grow 1
+ position relative
</style>
diff --git a/pages/index.vue b/pages/index.vue
index d7c5d98d..65364d4f 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -12,12 +12,7 @@ export default {
</script>
<template lang="pug">
-.layout(v-if="$store.getters['user/userUid']")
+.layout__wrap(v-if="$store.getters['user/userUid']")
LazyLayoutMobile(v-if="$store.state.ui.mobile")
LazyLayoutPc(v-if="$store.state.ui.pc")
</template>
-
-<style lang="stylus" scoped>
-.layout
- height 100%
-</style>