diff --git a/resources/js/components/navigation/Navigation.tsx b/resources/js/components/navigation/Navigation.tsx index f47cac4..ddcff9b 100644 --- a/resources/js/components/navigation/Navigation.tsx +++ b/resources/js/components/navigation/Navigation.tsx @@ -23,7 +23,6 @@ import { defineComponent, nextTick, onBeforeUnmount, - onMounted, ref, toRef, watch, @@ -861,104 +860,49 @@ export const SiteBottomNav = defineComponent({ const resolvedHref = (item: { href: string }) => item.href === '/' ? homeHref.value : item.href; - const isKeyboardOpen = ref(false); - - const checkFocus = () => { - const activeEl = document.activeElement; - const isInputFocused = - activeEl instanceof HTMLInputElement || - activeEl instanceof HTMLTextAreaElement || - activeEl?.getAttribute('contenteditable') === 'true'; - - let isViewportShrunk = false; - - if (typeof window !== 'undefined' && window.visualViewport) { - isViewportShrunk = - window.innerHeight - window.visualViewport.height > 150; - } - - isKeyboardOpen.value = isInputFocused || isViewportShrunk; - }; - - onMounted(() => { - if (typeof window === 'undefined') { - return; - } - - window.addEventListener('focusin', checkFocus); - window.addEventListener('focusout', () => { - setTimeout(checkFocus, 100); - }); - - if (window.visualViewport) { - window.visualViewport.addEventListener('resize', checkFocus); - window.visualViewport.addEventListener('scroll', checkFocus); - } - }); - - onBeforeUnmount(() => { - if (typeof window === 'undefined') { - return; - } - - window.removeEventListener('focusin', checkFocus); - window.removeEventListener('focusout', checkFocus); - - if (window.visualViewport) { - window.visualViewport.removeEventListener('resize', checkFocus); - window.visualViewport.removeEventListener('scroll', checkFocus); - } - }); - - return () => { - if (isKeyboardOpen.value) { - return null; - } - - return ( - - - {bottomNavItems.value.map((item) => ( - ( + + + {bottomNavItems.value.map((item) => ( + + + - - - {item.label} - - - ))} - - - ); - }; + {item.label} + + + ))} + + + ); }, }); diff --git a/resources/js/pages/Chat/Index.vue b/resources/js/pages/Chat/Index.vue index e153d4a..07b4561 100644 --- a/resources/js/pages/Chat/Index.vue +++ b/resources/js/pages/Chat/Index.vue @@ -476,20 +476,6 @@ const scrollToBottom = (smooth = true) => { }); }; -const handleInputFocus = () => { - scrollToBottom(true); - - if (typeof window !== 'undefined' && window.visualViewport) { - setTimeout(() => { - messageInputRef.value?.scrollIntoView({ - behavior: 'smooth', - block: 'nearest', - }); - scrollToBottom(true); - }, 150); - } -}; - let lastFetchTimestamp = 0; const fetchLatestMessages = async (force = false) => { const now = Date.now(); @@ -2144,7 +2130,6 @@ onUnmounted(() => { " :maxlength="maxLengthLimit" @input="handleInput" - @focus="handleInputFocus" @click="checkMentionTrigger" @keyup="checkMentionTrigger" @keydown="handleInputKeydown" diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index cd0f9d5..a2bebaf 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -18,7 +18,7 @@ } catch (_) {} })(); - + {{-- Browser chrome: top status bar + bottom nav bar (Chrome / Edge / Samsung Internet) --}}