mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 12:55:19 +00:00
refac: placeholder
This commit is contained in:
parent
e1e3009a30
commit
77358031f5
1 changed files with 13 additions and 1 deletions
|
|
@ -171,6 +171,18 @@
|
||||||
|
|
||||||
export let className = 'input-prose';
|
export let className = 'input-prose';
|
||||||
export let placeholder = 'Type here...';
|
export let placeholder = 'Type here...';
|
||||||
|
let _placeholder = placeholder;
|
||||||
|
|
||||||
|
$: if (placeholder !== _placeholder) {
|
||||||
|
setPlaceholder();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setPlaceholder = () => {
|
||||||
|
_placeholder = placeholder;
|
||||||
|
if (editor) {
|
||||||
|
editor?.view.dispatch(editor.state.tr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export let richText = true;
|
export let richText = true;
|
||||||
export let link = false;
|
export let link = false;
|
||||||
|
|
@ -971,7 +983,7 @@
|
||||||
StarterKit.configure({
|
StarterKit.configure({
|
||||||
link: link
|
link: link
|
||||||
}),
|
}),
|
||||||
Placeholder.configure({ placeholder }),
|
Placeholder.configure({ placeholder: () => _placeholder }),
|
||||||
SelectionDecoration,
|
SelectionDecoration,
|
||||||
|
|
||||||
...(richText
|
...(richText
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue