mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 16:44:23 +08:00
1 parent
9d6bf3e87f
commit
62631472ea
2 files changed
+58
-4
No files matched your search
@@ -2306,12 +2306,19 @@ export class CanvasEditor {
|
||||
async commitText() {
|
||||
const editing = this.input;
|
||||
if (!editing) return true;
|
||||
if (editing.saving) return false;
|
||||
if (editing.saving || editing.preparingCommit) return false;
|
||||
if (editing.composing) {
|
||||
editing.commitAfterComposition = true;
|
||||
return false;
|
||||
}
|
||||
editing.commitAfterComposition = false;
|
||||
const preparation = this.options.prepareTextCommit?.();
|
||||
if (preparation) {
|
||||
editing.preparingCommit = true;
|
||||
try { await preparation; }
|
||||
finally { editing.preparingCommit = false; }
|
||||
if (this.input !== editing) return !this.input;
|
||||
}
|
||||
const value = editTextValue(editing.input);
|
||||
if (!this.textChanged()) {
|
||||
this.closeText();
|
||||
|
||||
Reference in new issue
Block a user