CLASSROOMIO-T-132: [BUG] WYSIWIG editing has wrong behavior
CLASSROOMIO-T-132: Final test & remove logs CLASSROOMIO-T-132: Merge Fix (Tailwind Styling) CLASSROOMIO-T-132: Merge Fix Try out cl-editor CLASSROOMIO-T-132: Experimental gpttyping + wysiwig implementation Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com> Co-authored-by: Tunji Adeyemi <tunji@digdippa.com> Merge-request: CLASSROOMIO-MR-58 Merged-by: Best Admin <best@digdippa.com>
This commit is contained in:
committed by
Space Cloud
co-authored by
Rotimi Best
Tunji Adeyemi
parent
a3132371a1
commit
6a691d9fbd
@@ -29,6 +29,7 @@
|
||||
};
|
||||
|
||||
let quill = null;
|
||||
let isUserTyping = false;
|
||||
|
||||
function resetContent(docId) {
|
||||
if (quill && quill.setText) {
|
||||
@@ -64,6 +65,16 @@
|
||||
quill.on('text-change', function () {
|
||||
onChange(quill.getHTML());
|
||||
});
|
||||
quill.getModule('toolbar').container.addEventListener('mousedown', (e) => {
|
||||
e.preventDefault();
|
||||
isUserTyping = true;
|
||||
});
|
||||
quill.root.addEventListener('focus', () => {
|
||||
isUserTyping = true;
|
||||
});
|
||||
quill.root.addEventListener('blur', () => {
|
||||
isUserTyping = false;
|
||||
});
|
||||
});
|
||||
|
||||
$: {
|
||||
@@ -76,7 +87,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
$: setQuillHTML(content);
|
||||
$: if (!isUserTyping) {
|
||||
setQuillHTML(content);
|
||||
}
|
||||
|
||||
$: resetContent(docId);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user