Declined
Last Updated: 14 Feb 2024 14:18 by ADMIN
Fabien
Created on: 07 Feb 2024 16:12
Category: UI for Blazor
Type: Bug Report
1
Input is not focused when its adornment is clicked

Greetings,

I find input adornments very useful. However I noticed that when I click them, the control doesn't get the focus. E.g., with this code:

    <TelerikTextBox>
        <TextBoxPrefixTemplate>
            First name
        </TextBoxPrefixTemplate>
    </TelerikTextBox>

Clicking on First name doesn't do anything. I would expect the control to be focused when I do that.

You will find an image in attachment showing a green area that, when clicked, brings focus on the textbox. Input adornment is in dark gray. I'm using it as a label for the control but even if it was simply an icon, it would be strange to not be able to focus on the control when clicking it.

Attached Files:
1 comment
ADMIN
Nansi
Posted on: 14 Feb 2024 14:18

Hello Fabien,

By design, the adornments can serve many purposes and clicking them to get a specific default result may not be always desirable.

A solution for your case is to use a <label for="..."> element inside the PrefixTemplate, and an Id parameter for the input component. The code will look like this:

<TelerikTextBox Id="@firstname">
        <TextBoxPrefixTemplate>
        <label for="@firstname">First name</label>
        </TextBoxPrefixTemplate>
    </TelerikTextBox>

@code{
    private string firstname = "firstname-id";
}

Regards,
Nansi
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!