|
52 | 52 | <div> |
53 | 53 | <TabSelector v-model:selectedTabs="contextTabs" /> |
54 | 54 | </div> |
55 | | - <div class="flex gap-1"> |
| 55 | + <div class="flex gap-1 relative"> |
56 | 56 | <ScrollContainer |
57 | 57 | class="max-h-72 grow shadow-02 bg-white rounded-md" |
58 | 58 | itemContainerClass="p-1" |
|
68 | 68 | : 'Ask follow up...' |
69 | 69 | " |
70 | 70 | class="w-full block outline-none border-none resize-none p-2 field-sizing-content leading-5 text-sm wrap-anywhere" |
| 71 | + :style="{ paddingRight: `${sendButtonContainerWidth}px` }" |
71 | 72 | @keydown="onKeydown" |
72 | 73 | @compositionstart="isComposing = true" |
73 | 74 | @compositionend="isComposing = false" |
74 | 75 | /> |
75 | | - <Button |
76 | | - v-if="chat.isAnswering()" |
77 | | - variant="secondary" |
78 | | - class="px-2 grow-0 shrink-0" |
79 | | - @click="onStop" |
80 | | - > |
81 | | - {{ "Stop" }} |
82 | | - </Button> |
83 | | - <Button |
84 | | - v-else |
85 | | - variant="primary" |
86 | | - class="px-2 grow-0 shrink-0" |
87 | | - :disabled="!allowAsk" |
88 | | - @click="onSubmit" |
89 | | - > |
90 | | - <IconSendFill class="w-4 h-4 text-white" /> |
91 | | - </Button> |
92 | 76 | </div> |
93 | 77 | </ScrollContainer> |
| 78 | + <div |
| 79 | + ref="sendButtonContainerRef" |
| 80 | + class="absolute right-0 top-0 bottom-0 p-1" |
| 81 | + > |
| 82 | + <Button |
| 83 | + v-if="chat.isAnswering()" |
| 84 | + variant="secondary" |
| 85 | + class="px-2 grow-0 shrink-0 h-full" |
| 86 | + @click="onStop" |
| 87 | + > |
| 88 | + {{ "Stop" }} |
| 89 | + </Button> |
| 90 | + <Button |
| 91 | + v-else |
| 92 | + variant="primary" |
| 93 | + class="px-2 grow-0 shrink-0 h-full" |
| 94 | + :disabled="!allowAsk" |
| 95 | + @click="onSubmit" |
| 96 | + > |
| 97 | + <IconSendFill class="w-4 h-4 text-white" /> |
| 98 | + </Button> |
| 99 | + </div> |
94 | 100 | </div> |
95 | 101 | </div> |
96 | 102 | </div> |
@@ -118,7 +124,9 @@ import MessageAssistant from './Messages/Assistant.vue' |
118 | 124 | import MessageTask from './Messages/Task.vue' |
119 | 125 |
|
120 | 126 | const inputContainerRef = ref<HTMLDivElement>() |
| 127 | +const sendButtonContainerRef = ref<HTMLDivElement>() |
121 | 128 | const { height: inputContainerHeight } = useElementBounding(inputContainerRef) |
| 129 | +const { width: sendButtonContainerWidth } = useElementBounding(sendButtonContainerRef) |
122 | 130 |
|
123 | 131 | const userInput = ref('') |
124 | 132 | const isComposing = ref(false) |
|
0 commit comments