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: filter out shortcut triggers where key-modifier is same #2185

Merged
merged 2 commits into from Apr 21, 2021

Conversation

AnkushJadhav
Copy link
Contributor

@AnkushJadhav AnkushJadhav commented Apr 19, 2021

Description:

Shortcuts triggered an event to the queue for the shortcut's modifier key press. Added a filter to prevent the modifier key press from triggering the shortcut callback.

Fixes #2148

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

This is a great fix thanks, would it be possible to add a test that shows the shortcut is no longer sent to an Entry?

@andydotxyz
Copy link
Member

Oh one other thought - we try to keep method names in alphabetical order (grouped by type) so the new method probably belongs further down the file.

@AnkushJadhav
Copy link
Contributor Author

AnkushJadhav commented Apr 20, 2021

@andydotxyz Thanks. Will make the changes and update the PR asap. Since the fix is applicable for any component on the window that implements TypedShortcut, should the test for this be on window or on the entry widget?

@AnkushJadhav
Copy link
Contributor Author

@andydotxyz Added tests to a generic implementation of Shortcutable instead of entry, as the code change impacts all implementations of Shortcutable

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Great thank you very much :)

@andydotxyz andydotxyz merged commit 5977fa3 into fyne-io:develop Apr 21, 2021
@AnkushJadhav AnkushJadhav deleted the fix/2148 branch April 24, 2021 11:21
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.

None yet

2 participants