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

bugfix: fix CommandOnEnterBehavior not detecting 'enter' key #1622

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

benthecarman
Copy link
Contributor

@benthecarman benthecarman commented Jun 25, 2019

Addresses some comments in #1450

@danwalmsley
Copy link

danwalmsley commented Jun 25, 2019

@benthecarman thanks for this.

Most applications seem to execute commands on KeyDown rather than KeyUp.

Fear not however, the cause of the original bug is in the same area. Something else is handling the keydown event before it has chance to get to you.

You can resolve this by passing RoutingStrategies.Tunnel to the routes parameter or AddHandler as per.

https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Interactivity/Interactive.cs#L42

if that doesnt work, then try setting the handledEventsToo parameter to true (as a last resort).

Let me know if works and if you agree this would be a better fix, and if you want to know more about what all this Tunneling and Bubbling is just reach out to me here.

👍

@danwalmsley
Copy link

I think it might because some other control in the UI tree is probably setting the handled flag to true when the enter key is pressed. This means that your event handler wouldnt get called.

@benthecarman
Copy link
Contributor Author

Your fix worked, thanks!

@danwalmsley
Copy link

@benthecarman awesome, thanks for the contribution 👍

Copy link

@danwalmsley danwalmsley left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@nopara73 nopara73 merged commit bc72bc9 into WalletWasabi:master Jun 25, 2019
@benthecarman benthecarman deleted the command_on_enter branch July 2, 2019 16:07
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.

3 participants