mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac
This commit is contained in:
@@ -3,15 +3,13 @@
|
||||
|
||||
export let value = '';
|
||||
export let placeholder = '';
|
||||
export let rows = 1;
|
||||
export let required = false;
|
||||
export let className =
|
||||
'w-full rounded-lg px-3 py-2 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none resize-none h-full';
|
||||
|
||||
let textareaElement;
|
||||
|
||||
$: if (textareaElement) {
|
||||
if (textareaElement.innerText !== value) {
|
||||
if (textareaElement.innerText !== value && value !== '') {
|
||||
textareaElement.innerText = value;
|
||||
}
|
||||
}
|
||||
@@ -38,11 +36,12 @@
|
||||
style="field-sizing: content; -moz-user-select: text !important;"
|
||||
on:input={() => {
|
||||
const text = textareaElement.innerText;
|
||||
if (text.trim() === '\n') {
|
||||
if (text === '\n') {
|
||||
value = '';
|
||||
return;
|
||||
}
|
||||
value = text.trim();
|
||||
|
||||
value = text;
|
||||
}}
|
||||
on:paste={handlePaste}
|
||||
data-placeholder={placeholder}
|
||||
|
||||
Reference in New Issue
Block a user