Skip to content

Commit eeb6ec7

Browse files
committed
fix: mobile input screen styles (3)
1 parent d0766ac commit eeb6ec7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/src/views/Input.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
</template>
127127

128128
<script setup>
129-
import { ref, onMounted, computed } from 'vue'
129+
import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
130130
import { useSpamProtection } from '../composables/useSpamProtection'
131131
import { useRoomApi } from '../composables/useRoomApi'
132132
@@ -183,6 +183,9 @@ const backgroundStyle = computed(() => {
183183
})
184184
185185
onMounted(async () => {
186+
// Add classes to prevent zoom and scrolling on mobile
187+
document.body.classList.add('h-svh', 'overflow-hidden', 'touch-manipulation')
188+
186189
// Fetch room data
187190
try {
188191
roomData.value = await fetchRoom(props.roomId)
@@ -194,6 +197,10 @@ onMounted(async () => {
194197
}
195198
})
196199
200+
onBeforeUnmount(() => {
201+
document.body.classList.remove('h-svh', 'overflow-hidden', 'touch-manipulation')
202+
})
203+
197204
async function submitReaction (emoji) {
198205
// Only check cooldown, allow multiple API calls in progress
199206
if (!canSubmit.value) {

0 commit comments

Comments
 (0)