Skip to content

Commit a771389

Browse files
committed
feat: allows line breaks for mobile prompting
1 parent 8540784 commit a771389

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

apps/frontend/app/components/chat/interface/PrompterArea.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import type Lenis from 'lenis'
3+
import { useSidebar } from '~/lib/shadcn/components/ui/sidebar'
34
45
const props = defineProps<{
56
nearTopBottom: Array<null | boolean | number>
@@ -14,6 +15,7 @@ const emit = defineEmits<{
1415
const chatInput = defineModel<string>('chatInput', { required: true })
1516
1617
const isDev = import.meta.dev
18+
const sidebarContext = useSidebar()
1719
const chatContext = useChatContext()
1820
const { t } = useI18n()
1921
@@ -66,7 +68,12 @@ function handleSubmit({ confirmMultiStream = false }) {
6668
v-model="chatInputTA"
6769
:placeholder="chatPlaceholder"
6870
class="min-h-12 resize-none bg-transparent outline-none placeholder-secondary-700/60 dark:placeholder-secondary-300/60"
69-
@keydown.enter.exact.prevent="handleSubmit({ })"
71+
@keydown.enter.exact="(e) => {
72+
if (!sidebarContext.isMobile.value) {
73+
e.preventDefault()
74+
handleSubmit({ })
75+
}
76+
}"
7077
/>
7178
<div class="flex items-center justify-between">
7279
<div class="flex items-center">

0 commit comments

Comments
 (0)