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

Use "code" instead of "key" for undo/redo keyboard event, fixes shift+ctrl+z redo #3131

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

garrettjstevens
Copy link
Collaborator

Ctrl+Shift+Z for redo wasn't working for me, since it was using the event.key attribute being "z", and my system detects "Z" (upper case) for that case. This changes it to use event.code being "KeyZ" instead, which should work on any system.

It also updates the description of the shortcuts in the docs to use <kbd> and <samp> elements as suggested in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd. For example, instead of "ctrl+z", use Ctrl+Z.

@garrettjstevens garrettjstevens added the bug Something isn't working label Aug 11, 2022
@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #3131 (617634a) into main (ad9bf14) will decrease coverage by 0.03%.
The diff coverage is 13.63%.

@@            Coverage Diff             @@
##             main    #3131      +/-   ##
==========================================
- Coverage   58.81%   58.78%   -0.04%     
==========================================
  Files         648      648              
  Lines       29042    29042              
  Branches     7067     7067              
==========================================
- Hits        17082    17072      -10     
- Misses      11581    11591      +10     
  Partials      379      379              
Impacted Files Coverage Δ
products/jbrowse-desktop/src/rootModel.ts 29.95% <0.00%> (ø)
products/jbrowse-web/src/rootModel.ts 54.57% <27.27%> (-0.36%) ⬇️
...svg/src/SvgFeatureRenderer/components/Segments.tsx 85.71% <0.00%> (-7.15%) ⬇️
...src/SvgFeatureRenderer/components/FeatureLabel.tsx 80.55% <0.00%> (-5.56%) ⬇️
...gins/svg/src/SvgFeatureRenderer/components/util.ts 91.83% <0.00%> (-4.09%) ⬇️
...FeatureRenderer/components/ProcessedTranscript.tsx 87.32% <0.00%> (-1.41%) ⬇️
plugins/alignments/src/BamAdapter/BamAdapter.ts 72.07% <0.00%> (-0.91%) ⬇️
...ments/src/SNPCoverageAdapter/SNPCoverageAdapter.ts 57.33% <0.00%> (-0.67%) ⬇️
packages/core/util/layouts/GranularRectLayout.ts 86.86% <0.00%> (-0.43%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin
Copy link
Collaborator

lgtm, fixes it on my machine too

@cmdcolin cmdcolin merged commit f940c32 into main Aug 19, 2022
@cmdcolin cmdcolin deleted the undo_redo_shortcut_update branch August 19, 2022 19:41
@cmdcolin cmdcolin changed the title Use "code" instead of "key" for undo/redo keyboard event Use "code" instead of "key" for undo/redo keyboard event, fixes shift+ctrl+z redo Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants