migrate
This commit is contained in:
parent
bbe1313800
commit
039ac0be65
|
|
@ -980,7 +980,7 @@ async function insertEmoji(ev: MouseEvent) {
|
||||||
let pos = textareaEl.value?.selectionStart ?? 0;
|
let pos = textareaEl.value?.selectionStart ?? 0;
|
||||||
let posEnd = textareaEl.value?.selectionEnd ?? text.value.length;
|
let posEnd = textareaEl.value?.selectionEnd ?? text.value.length;
|
||||||
emojiPicker.show({
|
emojiPicker.show({
|
||||||
src: target as HTMLElement,
|
anchorElement: target as HTMLElement,
|
||||||
onChosen: emoji => {
|
onChosen: emoji => {
|
||||||
const textBefore = text.value.substring(0, pos);
|
const textBefore = text.value.substring(0, pos);
|
||||||
const textAfter = text.value.substring(posEnd);
|
const textAfter = text.value.substring(posEnd);
|
||||||
|
|
|
||||||
|
|
@ -256,20 +256,20 @@ async function insertEmoji(ev: MouseEvent) {
|
||||||
|
|
||||||
let pos = textareaEl.value?.selectionStart ?? 0;
|
let pos = textareaEl.value?.selectionStart ?? 0;
|
||||||
let posEnd = textareaEl.value?.selectionEnd ?? text.value.length;
|
let posEnd = textareaEl.value?.selectionEnd ?? text.value.length;
|
||||||
emojiPicker.show(
|
emojiPicker.show({
|
||||||
target as HTMLElement,
|
anchorElement: target as HTMLElement,
|
||||||
emoji => {
|
onChosen: (emoji) => {
|
||||||
const textBefore = text.value.substring(0, pos);
|
const textBefore = text.value.substring(0, pos);
|
||||||
const textAfter = text.value.substring(posEnd);
|
const textAfter = text.value.substring(posEnd);
|
||||||
text.value = textBefore + emoji + textAfter;
|
text.value = textBefore + emoji + textAfter;
|
||||||
pos += emoji.length;
|
pos += emoji.length;
|
||||||
posEnd += emoji.length;
|
posEnd += emoji.length;
|
||||||
},
|
},
|
||||||
() => {
|
onClosed: () => {
|
||||||
textareaReadOnly.value = false;
|
textareaReadOnly.value = false;
|
||||||
nextTick(() => focus());
|
nextTick(() => focus());
|
||||||
},
|
},
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,9 @@ function getHTMLElement(ev: MouseEvent): HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
function previewPicker(ev: MouseEvent) {
|
function previewPicker(ev: MouseEvent) {
|
||||||
emojiPicker.show(getHTMLElement(ev));
|
emojiPicker.show({
|
||||||
|
anchorElement: getHTMLElement(ev),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
watch([
|
watch([
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue