8000 Selection can't span across existing text and input · Issue #54 · hostilefork/replpad-js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Selection can't span across existing text and input #54

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

Open
hostilefork opened this issue Apr 14, 2019 · 2 comments
Open

Selection can't span across existing text and input #54

hostilefork opened this issue Apr 14, 2019 · 2 comments
Assignees

Comments

@hostilefork
Copy link
Owner
hostilefork commented Apr 14, 2019

When selecting, you currently can't select text that spans across past input and the current input. (I think you might have been able to before?)

Your selection has to be either all on the input, or all on the past data. Ideally you should be able to select across it all and copy it, like copying a transcript.

(See also the theoretical idea of making transcripts replayable...I think that would be pretty cool if people could just grab text from StackOverflow questions and paste it directly, and have the REPL go into "replay mode"...maybe even diffing your output from the transcript)

@BrianOtto
Copy link
Collaborator
BrianOtto commented Apr 18, 2019

I haven't found any documentation to back this up yet, but I'm doubting that this is possible to fix. A contenteditable div has it's own selection range, which is outside of the main HTML document. So it makes sense for the browser to stop selecting, when you start selecting text within the input and then reach the edge of the div.

However, it looks like this does work on Firefox, but only if you start selecting text outside the input div first and then move towards it. It also works in both browsers if you use CTRL-A.

I think it might be better to just provide a "copy transcript" button that either downloads the text or copies it to your clipboard, instead of trying to find a workaround for this.

@hostilefork
Copy link
Owner Author

I think it might be better to just provide a "copy transcript" button that either downloads the text or copies it to your clipboard, instead of trying to find a workaround for this.

It may or may not be "worth it", but... it looks like maybe you can notice when you're making a selection and switch the contenteditable-ness to false:

https://stackoverflow.com/a/10952281

My feeling about wacky workarounds is that they're going to need some kind of settings page, where if the cure turns out to be worse than the symptom for someone in some browser they can turn it off.

Agreement on being low priority in the grand scheme of things--don't bother yourself w/it, just something I noticed. Ticket's just to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0