Pretty straight-forward question. When I click on an input field I want to select-all the text so when I start typing it over-writes what was previously there. Anyone know how to do this?
Seems the following should work:
<input matInput (click)="$event.target.select()">
Example
What worked best for me is onfocus="this.select()"
<input matInput onfocus="this.select()">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With