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

TextBox: update command states on selection changes #5935

Merged

Conversation

DmitryZhelnin
Copy link
Contributor

What does the pull request do?

Fixes #5924
Current logic to update context menu commands relies on the fact that OnLostFocus event handler of the TextBox will be invoked when context menu is opening. But for readonly TextBox there are no active context menu items, so FocusManages can't focus anything and command states do not update.

What is the current behavior?

Context menu Copy command of the readonly TextBox is disabled

What is the updated/expected behavior with this PR?

Context menu Copy command of the readonly TextBox is enabled

How was the solution implemented (if it's not obvious)?

This PR adds command state updates when TextBox selection is changed.

Checklist

Fixed issues

Fixes #5924

@dnfadmin
Copy link

dnfadmin commented May 17, 2021

CLA assistant check
All CLA requirements met.

Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

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

Thanks!

@maxkatz6 maxkatz6 enabled auto-merge May 19, 2021 14:38
@maxkatz6 maxkatz6 merged commit 952017e into AvaloniaUI:master May 19, 2021
danwalmsley pushed a commit that referenced this pull request May 19, 2021
…only-textbox

TextBox: update command states on selection changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextBox with IsReadOnly=True doesn't allow to copy text
4 participants