Skip to content

Allow triple left click on a TextBox to select all text - #4081

Merged
Keboo merged 5 commits into
MaterialDesignInXAML:masterfrom
JLdgu:master
Aug 21, 2026
Merged

Allow triple left click on a TextBox to select all text#4081
Keboo merged 5 commits into
MaterialDesignInXAML:masterfrom
JLdgu:master

Conversation

@JLdgu

@JLdgu JLdgu commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Triple clicking in a textbox to select all text is a common action on Windows applications

@corvinsz corvinsz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I few things I noticed:

  1. We should type check against TextBoxBase so this behavior also works for the RichTextBox
  2. Maybe an example dedicated to this attached property with a small description would be helpful, especially because this behavior is not something consumers can "just see". Please don't forget the MD3 demo app 😄
  3. In my opinion the test you added should also test the negative (materialDesign:TextFieldAssist.SelectAllOnTripleClick="False") behavior to prevent any regressions.

Comment thread src/MaterialDesignThemes.Wpf/TextFieldAssist.cs Outdated
Comment thread src/MaterialDesignThemes.Wpf/TextFieldAssist.cs Outdated
JLdgu and others added 3 commits August 17, 2026 09:40
Co-authored-by: Corvin <43533385+corvinsz@users.noreply.github.com>
Co-authored-by: Corvin <43533385+corvinsz@users.noreply.github.com>

@corvinsz corvinsz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

The tests could be made data-driven, but I’m totally fine with the current approach as well.

@Keboo Keboo added the release notes Items are likely to be highlighted in the release notes. label Aug 21, 2026
@Keboo Keboo added this to the 5.3.3 milestone Aug 21, 2026
Makes triple-click-to-select-all the default behavior for TextBoxes using Material Design styles, aligning with common user expectations for text input fields.

Refactors TextFieldAssist Get/Set methods to use TextBoxBase for improved type specificity and encapsulates the event handler. Updates demos and UI tests to reflect this new default and accurately demonstrate both enabled and disabled states.

@Keboo Keboo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, thank you! For some reason I thought this was already the default. I tweaked it slightly so that it will be on by default for anyone using the library but let people opt out with the AP.

@Keboo
Keboo enabled auto-merge (squash) August 21, 2026 04:43
@Keboo
Keboo merged commit e42b5a8 into MaterialDesignInXAML:master Aug 21, 2026
2 checks passed
@Keboo Keboo modified the milestones: 5.3.3, 5.4.0 Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement release notes Items are likely to be highlighted in the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants