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

🐛♻️ Fix selection of multiple staves by cmd-click #897

Merged
merged 2 commits into from
Jun 25, 2022

Conversation

jinh0
Copy link
Collaborator

@jinh0 jinh0 commented Jun 22, 2022

Fixes #871 .

Refactors clickHandler() in Select.ts .

- `this` keyword is annotated for type safety
- Arrays are given SVGGraphicsElement[] to fix type errors
- isMultiSelect() is used as a helper function for readability
- Confusing variable names `mode` and `temp` are changed to `selectedClass` and `selectionMode` along with removing the switch case for the simpler "dictionary" lookup with `modeToClass`.
Previously, `unselect()` was called to unselect all previously selected elements, which should not happen when the user wants to select multiple staves.

This issue is fixed by adding a check to see whether multiple selection is chosen or not.
@jinh0 jinh0 requested a review from yinanazhou June 22, 2022 20:55
Copy link
Member

@yinanazhou yinanazhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user can only select the staff line by clicking on any element on the staff line, is there a solution that we can select a staff line by clicking anywhere on the staff?

@yinanazhou yinanazhou merged commit 86aa21d into develop Jun 25, 2022
@jinh0 jinh0 deleted the cmd-select-staff-fix branch July 14, 2022 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants