[Enhanced code blocks] Make console prompts unselectable #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
In #169 (comment), @eecs441staff suggested skipping prompts and output when using click+drag while selecting multiple lines in a console prompt. At the time, I thought it would not be easy to implement given the limitations of the JS text selection API.
I feel a bit silly in retrospect for forgetting to consider the CSS
user-select
property 😅This PR proposes making the console prompts in enhanced
console
code blocks completely unselectable (by clicking line numbers or by selecting text the old-fashioned way).Demo
Visit the demo URL, and click+drag on the line numbers in the
console
code block.Demo URL: https://preview.sesh.rs/previews/eecs485staff/primer-spec/177/demo/enhanced-code-blocks.html#console-example
Screen recording:
Screen.Recording.2022-04-23.at.4.53.52.PM.mov
Open question: Should we make console output unselectable?
It's extremely easy to skip the console output too. However, I wonder if students might find it confusing that they have no way to select the console output. Then again, would students ever need to be able to select the output?
CC @awdeorio, @sugihjamin in case you have strong opinions 😃