kendo-textbox angular how to turn off autocomplete in a textbox input

0 Answers 17 Views
TextBox
Lakhwinder
Top achievements
Rank 1
Lakhwinder asked on 13 Jun 2024, 09:40 PM

i am implementing a kendo-texbox in reactive form in angular every time user click in a input -textbox it shows a list of autocompletes .

i want to turn it off as we did in html forms "autocomplete = off" how it works with kendo-textbox ???

 

thanks

Georgi
Telerik team
commented on 18 Jun 2024, 11:56 AM

Hi Lakhwinder,

Thank you very much for the details provided.

if I understood you correctly, you are currently utilizing the Kendo UI for Angular TextBox and are looking for an approach that would allow you to remove the default input suggestion dropdown that appears in certain browsers. Please, correct me if I misunderstood you.

Having thoroughly examined the matter, I believe that this behavior is more of a browser specific rather than specificity of the TextBox component since the same suggestions dropdown also appears for the default HTML <input> tag as you have mentioned correctly: 

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_test

After some investigation of the matter, I found a Stack Overflow thread that recommends multiple approaches that would prevent this suggestions dropdown from appearing: 

https://stackoverflow.com/questions/32785958/disable-input-text-suggestions-in-edge/

I tested some of the suggestions in the above-mentioned thread and it seems to me that setting the aria-autocomplete property of the <input> removes the dropdown. To implement this approach, the developer can use the .k-input-inner CSS selector and some custom JavaScript code: 

ngAfterViewInit() {
    let input: HTMLInputElement = document.querySelector('.k-input-inner');
    input.ariaAutoComplete = 'none';
}

For your convenience, I am sending a StackBlitz demo that implements this approach:

https://stackblitz.com/edit/angular-gci7jr-yepapn

I hope the provided information sheds some light on the matter. Please, let me know if I am missing out on something.

Regards,
Georgi
Progress Telerik

No answers yet. Maybe you can help?

Tags
TextBox
Asked by
Lakhwinder
Top achievements
Rank 1
Share this question
or