Skip to content

Commit

Permalink
fix(Chatbar): adjust autoFocus behavior for Android and iOS devices, …
Browse files Browse the repository at this point in the history
…so keyboard will not be opened when user enter in the chat
  • Loading branch information
lgmarchi committed Dec 10, 2024
1 parent 8256f78 commit dc07324
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/layouts/Chatbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
import { type Message as MessageType } from "$lib/types"
import { ProfilePicture } from "$lib/components"
import CombinedSelector from "$lib/components/messaging/CombinedSelector.svelte"
import { checkMobile, isiOSMobile } from "$lib/utils/Mobile"
import { checkMobile, isAndroidOriOS, isiOSMobile } from "$lib/utils/Mobile"
import { UIStore } from "$lib/state/ui"
import { emojiList, emojiRegexMap } from "$lib/components/messaging/emoji/EmojiList"
import { tempCDN } from "$lib/utils/CommonVariables"
import { MessageEvent } from "warp-wasm"
import StoreResolver from "$lib/components/utils/StoreResolver.svelte"
import MessageText from "$lib/components/messaging/message/MessageText.svelte"
import { ToastMessage } from "$lib/state/ui/toast"
export let replyTo: MessageType | undefined = undefined
export let emojiClickHook: (emoji: string) => boolean
Expand Down Expand Up @@ -159,7 +158,7 @@
return result
}
onMount(() => {
onMount(async () => {
hackVariableToRefocusChatBar.set(Math.random().toString())
})
</script>
Expand All @@ -172,7 +171,7 @@
hook={`${activeChat.id}-${$hackVariableToRefocusChatBar}`}
alt
placeholder={$_("generic.placeholder")}
autoFocus={true}
autoFocus={isAndroidOriOS() ? false : true}
bind:value={$message}
rounded
rich={markdown}
Expand Down

0 comments on commit dc07324

Please sign in to comment.