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

Shift-click to extend text selection does not work in cell output area #4800

Closed
jjpr-mit opened this issue Jun 28, 2018 · 5 comments · Fixed by #6015
Closed

Shift-click to extend text selection does not work in cell output area #4800

jjpr-mit opened this issue Jun 28, 2018 · 5 comments · Fixed by #6015
Assignees
Labels
bug help wanted pkg:notebook status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Design and UX
Milestone

Comments

@jjpr-mit
Copy link

When I select some subset of the text in the output area of a cell, then move the mouse pointer to a spot inside the same output area but outside the already-selected text, hold the shift key, and click, I expect the highlighted area indicating selected text to expand to where the mouse pointer is. Instead, nothing happens in response to the shift-click.

Shift-click for selection expansion is a default behavior in Chrome (and works in the input area), so I assume Jupyter is intercepting or overriding that behavior inside the output area.

This makes it unreasonably difficult to put large amounts of text from a cell's output area into the clipboard, since you can't start a selection, then use the scroll bar to traverse thousands of lines of text, then finish the selection with shift-click. The only way to select large amounts of text is to click and drag off the edge of the window, and then wait while the browser scrolls.

Is there a way to fix this?

(Using Chrome 67, Jupyter Lab 0.32.0, macOS 10.13.5)

@jasongrout
Copy link
Contributor

Thanks.

It looks like we are explicitly disabling that behavior in

// Prevent browser selecting text in prompt or output
event.preventDefault();
. I think the reasoning is that shift-click was supposed to be for selecting multiple cells. You have a very good point, though. I think the thing to do is to see if there is a happy medium between the shift-click-to-extend-cell-selection and the shift-click-to-extend-output-selection.

@jasongrout jasongrout added this to the Beta 4 milestone Jun 28, 2018
@blink1073 blink1073 modified the milestones: 0.34, 0.35 Aug 13, 2018
@blink1073 blink1073 modified the milestones: 0.35, 1.0 Sep 5, 2018
@tgeorgeux
Copy link
Contributor

tgeorgeux commented Nov 14, 2018

I think it makes sense to set it up that if you start with focus (I think this shakes out as a portion of the output already selected) within the cell output, you can select more within that output using shift-click. In the case that your initial selection is a whole cell (input and output) the existing behavior continues.

@jasongrout Thoughts?

@jasongrout
Copy link
Contributor

jasongrout commented Nov 14, 2018

It looks like we can determine if text is selected using the selection api: https://developer.mozilla.org/en-US/docs/Web/API/Selection. Perhaps we should examine that in the code to determine if shift-click should select cells, or just more text.

@tgeorgeux
Copy link
Contributor

I'd love to hear what come of this. It's a little outside my wheel-house. @jjpr-mit do you have any interest in taking a look at this? 😺

@tgeorgeux
Copy link
Contributor

@jasongrout what if we just treated this behavior as command mode behavior vs edit mode behavior. I was doing some work on Command vs Edit mode today and it reminded me of the discussion here. Would it be difficult treat in cell shift-clicks during edit mode differently than command mode? That way you can start with a blinking cursor and select text as you please.

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug help wanted pkg:notebook status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Design and UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants