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

Recalculate selected code upon copy in submission #5157

Merged
merged 4 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/assets/javascripts/code_listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
return; // if there is no code selection, let the browser handle the copy event
}

if (userAnnotationState.formShown) {
return; // if the annotation form is shown, let the browser handle the copy event

Check warning on line 59 in app/assets/javascripts/code_listing.ts

View check run for this annotation

Codecov / codecov/patch

app/assets/javascripts/code_listing.ts#L59

Added line #L59 was not covered by tests
}

const selectedCode = submissionState.code.split("\n").slice(selection.row - 1, selection.row + selection.rows - 1);
// on the first and last line, selection might only cover part of the line
// only copy the selected columns/characters
Expand Down