Is there a Blazor-native way to select all text in an input field on focus?

Viewed 1700

Is there a Blazor-native way to select all text in a text input field on user focus? Something like this in JavaScript:

<input onClick="this.select();" >

I've built a JS interop function to do this, but I'd rather use something in-the-box.

1 Answers

Steven,

Just use the HTML from your question.

<input onClick="this.select();" >

That also works in Blazor

Related