Skip to content

Commit

Permalink
Merge branch 'main' of github.com:zusizusi/conflu-japanese-issue-chro…
Browse files Browse the repository at this point in the history
…me-extension
  • Loading branch information
zusizusi committed Jul 1, 2024
2 parents 3d1fedc + 5c42521 commit c41a221
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conflu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let previousCursorPosition = 0;
let previousCursorPosition = -1;
const keydownHandler = (event) => {
const activeField = document.activeElement;
// role="textbox"の場合は、カーソル位置を取得
Expand All @@ -7,7 +7,7 @@ const keydownHandler = (event) => {
const cursorPosition = selection.anchorOffset;

// 入力カーソル位置が 1 以外から 1 に変わった場合
if ((previousCursorPosition !== 1 && previousCursorPosition !== 0) && cursorPosition === 1 && (event.key === "Process" || event.key == "Shift")) {
if (previousCursorPosition !== cursorPosition && cursorPosition === 1 && (event.key === "Process" || event.key == "Shift")) {
activeField.focus();
document.execCommand('insertText', false, ' ');
}
Expand Down

0 comments on commit c41a221

Please sign in to comment.