Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ⌘V without having to focus a block first #2303

Closed
jasmussen opened this issue Aug 9, 2017 · 7 comments
Closed

Enable ⌘V without having to focus a block first #2303

jasmussen opened this issue Aug 9, 2017 · 7 comments
Labels
[Feature] Paste [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor.

Comments

@jasmussen
Copy link
Contributor

Copy and paste in Gutenberg is making strides. ⌘A works to select all blocks, when you have no block selected. ⌘C works to copy those. The paste experience could use some love. Half of this is ticketed in #2180. The other half is to allow pasting without first focusing a block. Here's a video:

https://cloudup.com/cSe2akr7WqJ

Current behavior:

  • ⌘A on the demo content, then ⌘C
  • Click "New Post"
  • Click the empty text paragraph placeholder
  • ⌘V to paste

☝️ this works.

Desired behavior:

  • ⌘A on the demo content, then ⌘C
  • Click "New Post"
  • ⌘V to paste

Notably, it'd be nice to just be able to paste, without having anything selected first.

CC: @iseulde @georgeh

@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor. labels Aug 9, 2017
@jasmussen jasmussen added this to the Release 1.0 milestone Aug 9, 2017
@ellatrix
Copy link
Member

ellatrix commented Aug 9, 2017 via email

@jasmussen
Copy link
Contributor Author

What's wrong with focussing the editor first? This is consistent in all editors. How do we know where to insert the content otherwise?

Perhaps I misphrased the initial ticket. Nothing wrong with that, we shouldn't remove that feature. It would be nice if, in addition to that, it worked even without focusing it. This is sort of the Apple Pages app-metaphor. That is, as soon as you are "in the app", pasting works, even if a textfield isn't focused first. I think it would go nicely in hand with the idea that you can deselect all blocks, press ⌘A with nothing selected, then it'd be nice if you could also ⌘V with nothing selected. What do you think?

@ellatrix
Copy link
Member

ellatrix commented Aug 9, 2017

I think I read it correctly. With asking "what's wrong with..." I meant to ask why that flow is not good enough. In Google Docs and Apple Pages, there is a caret (selection) all the time. You can't remove it. Is this what you mean? We should have a selection all the time? Without it, there's no way to know where to insert the content.

@afercia
Copy link
Contributor

afercia commented Aug 9, 2017

Not arguing, just to point out one more thing to consider:

  • Cmd/Ctrl - A to select the blocks breaks the native browser behavior; if (because reasons) I want to select the whole page text, I can't do that now

Comparison with Google Docs and Apple Pages doesn't seem entirely correct to me. This is not a single page app.

@jasmussen
Copy link
Contributor Author

In Google Docs and Apple Pages, there is a caret (selection) all the time. You can't remove it. Is this what you mean?

Right, my mistake, in Google Docs the caret is always there. In Apple Pages you can click the gray area outside the white page canvas and deselect it, then paste. But see also my comment below 👇

Comparison with Google Docs and Apple Pages doesn't seem entirely correct to me. This is not a single page app.

Fair enough. What if the white canvas that holds the blocks was considered an area that could receive focus, and ⌘ A and ⌘ V worked inside that canvas? We might even add a focus highlight like this one: https://codepen.io/joen/pen/Nvjror — would that change things?

@georgeh
Copy link
Contributor

georgeh commented Aug 9, 2017

What if the white canvas that holds the blocks was considered an area that could receive focus, and ⌘ A and ⌘ V worked inside that canvas? We might even add a focus highlight like this one: https://codepen.io/joen/pen/Nvjror — would that change things?

I like that solution because it keeps the blocks first-class UI objects. If the canvas has focus ⌘A and ⌘V should work on a block level. While focused on an individual block, ⌘V and ⌘A should probably work as-is - quietly creating new blocks or selecting everything in the current block.

Compare that to how this comment field works. ⌘A won't select all comments while the textarea has focus, but if I click outside I can select everything. The canvas select-all seems like an analog to that, and so it's hopefully intuitive.

@jasmussen
Copy link
Contributor Author

Although I still think this would be really really nice to have, it is just that, nice to have. Closing for someone else to potentially revisit in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

5 participants