You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be useful (at least for my use case) to have a “move” event, similar to the current switch event. It fires when the user holds e.g. the Alt key together with the arrow up/down key at the top/bottom of the element, thus indicating that the element should be moved up or down.
It fires when the user holds e.g. the Alt key together with the arrow up/down key
Is this inspired from some other tool where you can move elements this way? I'm not familiar with this combo.
But generally we're open to the idea.
There is a PR on the way regarding the switch event to allow for some more natural cursor interaction when switching between blocks. It probably makes sense to build your work from that or wait until we merge it in the coming days.
Is this inspired from some other tool where you can move elements this way? I'm not familiar with this combo.
It’s not.
I’m just looking for a comfortable way to move paragraphs in a document up/down. Click-and-drag works already, but the grip icon doesn’t seem to work for users. Holding Alt seems nice and unintrusive, although the actual key should probably be configured (even disabled in the default config, in which case the “move” event wouldn’t fire).
There is a PR on the way regarding the switch event […]
Do you have an ETA for that PR? It would probably make sense for me to wait and build on top of that?
the Alt key together with the arrow up/down key at the top/bottom of the element, thus indicating that the element should be moved up or down.
Actually, vscode is using ALT + ⬆️ or ALT + ⬇️ to move text around.
But its' slightly unintuitive because ALT + ⬅️ and ALT + ➡️ are shortcut to move the cursor one word to the left and right.
@marcbachmann, well if you want I can create a PR from my local change and you can take a look. If it’s too invasive and not too useful we can always close later…
Activity
peyerluk commentedon Jun 28, 2021
Is this inspired from some other tool where you can move elements this way? I'm not familiar with this combo.
But generally we're open to the idea.
There is a PR on the way regarding the switch event to allow for some more natural cursor interaction when switching between blocks. It probably makes sense to build your work from that or wait until we merge it in the coming days.
jenstroeger commentedon Jun 28, 2021
It’s not.
I’m just looking for a comfortable way to move paragraphs in a document up/down. Click-and-drag works already, but the grip icon doesn’t seem to work for users. Holding Alt seems nice and unintrusive, although the actual key should probably be configured (even disabled in the default config, in which case the “move” event wouldn’t fire).
Do you have an ETA for that PR? It would probably make sense for me to wait and build on top of that?
peyerluk commentedon Jun 28, 2021
It's merged now :)
jenstroeger commentedon Jun 29, 2021
Great, thank you!
Also, I just noticed that the
'move'
event is already added but doesn’t seem to be used anywhere? Is that a relic from previous versions?editable.js/src/core.js
Lines 511 to 514 in 8e477fa
peyerluk commentedon Jun 30, 2021
Yes. That's a relic.
jenstroeger commentedon Jun 30, 2021
Lucky me, I’ve repurposed it for now 👍🏼
marcbachmann commentedon Oct 5, 2021
Actually, vscode is using
ALT + ⬆️
orALT + ⬇️
to move text around.But its' slightly unintuitive because
ALT + ⬅️
andALT + ➡️
are shortcut to move the cursor one word to the left and right.marcbachmann commentedon Oct 5, 2021
I guess we can close this for now
jenstroeger commentedon Oct 5, 2021
Dang, I didn’t know! (Well, I barely use VS Code anyway.) But yes, just tried it out and that’s exactly how
ALT + ⬆️
orALT + ⬇️
work on my site 👍🏼I wouldn’t say it’s unintuitive — I got used to it quickly 😉
Bummer. Well, I’ll just keep it in my fork… But in that case, you might want to remove the
"move"
string above?marcbachmann commentedon Oct 5, 2021
Oh, we could implement if you really want to. But at the moment it's also conflicting with jumping to the end of a block.
I'm not really a fan to change the default behavior.
marcbachmann commentedon Oct 5, 2021
I'd rather bind
CMD + ALT + ⬆️
jenstroeger commentedon Oct 5, 2021
@marcbachmann, well if you want I can create a PR from my local change and you can take a look. If it’s too invasive and not too useful we can always close later…
And on Windows that’d be
CTRL + ALT + ⬆️
?marcbachmann commentedon Oct 5, 2021
yes