core icon indicating copy to clipboard operation
core copied to clipboard

Copy/Paste Behavior

Open Dwaynekj opened this issue 9 years ago • 8 comments

Current Hypergrid Rules established for copy buffer.

  • command and control keys are ignored ~~fixed~~
  • COPY operation copies all row selections (contiguous or not) but only the youngest region selection. We believe this is appropriate and OK as is. (Note that Excel does this for row selections; Excel only allows a single region selection to be copied.)
  • COPY operation gives priority to region selections over row selections even when the row selections are younger. This is not OK and needs to be fixed.

Dwaynekj avatar Aug 08 '16 19:08 Dwaynekj

Simplest solution we arrived at for the last item above is: If there are ​​any​​ row selections, they get copy priority regardless of when created. Otherwise, the youngest region selection is copied.

Dwaynekj avatar Aug 08 '16 19:08 Dwaynekj

@Dwaynekj currently hypergrid does not support paste functionality. Is this something desired? I have implemented this locally and am wondering if this is something that I should fork over to the repo? Probably before that though, if paste functionality is something desired, there should be a discussion on the exact specs on how it should work. I.e. -Should there be any type validation on pasted value? -Should pasting be limited to editable cell? -How to deal with unequal copy vs. paste region sizes?

noahtaylor avatar Oct 21 '16 14:10 noahtaylor

Hey @noahtaylor I think the current line of thinking is that it would be a good tutorial to add to our wiki pages. In keeping in line with of HyperGrid as a grid and not a spreadsheet, we feel the core should enable the ability to create a feature like this for a developer-user to implement. Similarly with the questions you posed

Would you be open to sharing the changes you made? It might be useful as a wiki and some changes may be pertinent in HyperGrid core

Dwaynekj avatar Oct 21 '16 19:10 Dwaynekj

@Dwaynekj I can certainly share what I did, just been busy with some high priority releases. I can post it here in a few days unless there is a better place for it.

noahtaylor avatar Oct 25 '16 12:10 noahtaylor

@noahtaylor Ok thanks!

Dwaynekj avatar Oct 25 '16 14:10 Dwaynekj

@Dwaynekj I have created a copy and paste fiddle here: https://jsfiddle.net/4qqzkbL3/2/ Logic is incorporated in the dom 'paste' listener.

noahtaylor avatar Oct 28 '16 17:10 noahtaylor

@noahtaylor Thanks We will evaluate for 1.3.0

Dwaynekj avatar Oct 31 '16 18:10 Dwaynekj

@noahtaylor We've decided to keep this request out of 1.3.0 based on priorities and evaluation of what layer a paste feature should be in the grid. We have it queued up for following sprint.

Dwaynekj avatar Nov 03 '16 17:11 Dwaynekj