BbTextArea ElementReference #304
|
Is there any way to focus this component without writing js? It does not expose ElementRefence |
Answered by
mathewtaylor
Sep 19, 2026
Replies: 1 comment
|
Yes — no JavaScript needed. <BbTextarea @ref="notes" @bind-Value="text" />
<BbButton OnClick="@(() => notes!.FocusAsync())">Focus</BbButton>
@code {
private BbTextarea? notes;
}
|
0 replies
Answer selected by
mathewtaylor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes — no JavaScript needed.
BbTextareaexposes both:FocusAsync()returns aValueTaskand focuses the underlying element.Elementgives you theElementReferenceif you need it for something else.BbInputand the other text inputs carry the same pair. Sorry this sat unanswered for so long.