I don't see any examples of adding an icon within a input component. I need to be able to put it on the right of left side of icon within the input box. Can someone explain how to do this?
Thaban
3 Answers, 1 is accepted
0
Stefan
Telerik team
answered on 18 Nov 2019, 09:15 AM
Hello, Thaban,
This can be achieved using some of the KendoReact classes and a span element to wrap the input and the icon.
This is an example of inputs with icon and the left and input with icon on the right:
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
How can i use this with Input React Component. I need to also use this with Masked Input and Numeric Input. This method is seems to create input using html tag <input> not the react input <Input>.
Thanks,
Thaban
0
Stefan
Telerik team
answered on 19 Nov 2019, 09:37 AM
Hello, Thaban,
Currently, this is the supported way, as the input elements do not allow rendering other elements inside of them. This is how the DOM input element works, and we have no control over it.
The only possibility is to use a wrapper element and place the icon inside it, then set a border to that element, and remove the border of the input type element.
As for the Numeric and the MaskedTextBox, this will require custom DOM manipulations to add the icon element inside of it:
Please have in mind that this is not supported out of the box, so it will require custom code and styles.
Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items