Closed moughxyz closed 5 years ago
So this one was actually rather simple. When a bullet is edited (a key is pressed), the cursor automatically moves to the end of the line on keyup. So if you also clicked on the middle of a line and typed a letter, the cursor would also move to the end of line. By disabling the cursor from moving the bullet's text can be selected with ctrl/cmd+a as well as edited in the middle of the text rather than just the end.
Changed this:
function editBullet(address, content) {
return {
type: EDIT_BULLET,
exec: (state) => {
let node = getNode(copy(address), state.root);
node.content = content;
focusNode(node); // moves cursor to end of the bullet
return state;
}
}
}
To this:
function editBullet(address, content, focus=false) {
return {
type: EDIT_BULLET,
exec: (state) => {
let node = getNode(copy(address), state.root);
node.content = content;
if (focus) {
focusNode(node);
}
return state;
}
}
}
It's good to close issues via commits, this way, there's a historical record of how each issue was fixed without having to comment it. So in your code, when you make the fix, you create a new commit with the text "Fixes #1", and when you push it to GitHub, it will automatically close this issue and link the commit, so we can see the exact code changes.
Tested on Safari and Chrome 73 on macOS.