mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
tinymce-plugins: fix keyboardquirks plugin
This commit is contained in:
@@ -73,7 +73,7 @@ function androidGboardEnterKeyBug(editor) {
|
||||
if (e.inputType === "insertCompositionText") {
|
||||
if (e.data?.endsWith("\n") && inputState.isKeyUnidentified) {
|
||||
inputState.isKeyUnidentified = null;
|
||||
inputState.moveSelectionToNextNode = true;
|
||||
inputState.forceMoveSelectionToNextNode = true;
|
||||
}
|
||||
} else {
|
||||
inputState.isKeyUnidentified = null;
|
||||
@@ -162,6 +162,13 @@ function androidBackspaceKeyQuirk(editor) {
|
||||
container: range.startContainer,
|
||||
offset: range.startOffset,
|
||||
};
|
||||
|
||||
// Weird behavior: tinymce removes 1 (and only 1) trailing whitespace.
|
||||
// It doesn't matter if there are more than 1. So we need to account for that.
|
||||
if (range.startContainer.textContent.endsWith(" ")) {
|
||||
inputState.selection.offset -= 1;
|
||||
}
|
||||
|
||||
inputState.forcePreserveSelection = true;
|
||||
} else {
|
||||
inputState.selection = {};
|
||||
|
||||
Reference in New Issue
Block a user