microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

Disable autofill on mgt-search-box

Open dougroutledge opened this issue 1 year ago • 6 comments

Please make the auto-fill optional on this control. Many times is drops over important parts of the search results, frustrating users.

image

dougroutledge avatar Sep 04 '24 17:09 dougroutledge

Hi @dougroutledge, which browser are you using this control on?

Mnickii avatar Oct 01 '24 10:10 Mnickii

Edge, Chrome, Brave

dougroutledge avatar Oct 01 '24 11:10 dougroutledge

It's likely that this is an external feature, seeing as our control has autocomplete set to off. See this similar issue on edge

Mnickii avatar Oct 03 '24 08:10 Mnickii

It's definitely not, the other input controls do not exhibit it, and the normal autocomplete ones that do on other pages, do not look the same graphically. This is 100% from the underlying fluent control being used. A way to turn it off that passes through to that would be nice.

dougroutledge avatar Oct 04 '24 13:10 dougroutledge

I had the same problem with the mgt-people-picker, I was able to turn it off programmatically querying the DOM and setting the autocomplete attribute of the control to off. By default the autocomplete property is being set in the parent component instead of the input itself.

I'm using React + Typescript:

useEffect(() => {
    const fluent = ref.current?.shadowRoot?.querySelector('#people-picker-input');
    const inputControl = fluent?.shadowRoot?.querySelector('#control');
    if (!inputControl) return;
    (inputControl as HTMLInputElement).setAttribute('autoComplete', 'off');
}, []);

image

GuillermoCasalCaro avatar Nov 05 '24 12:11 GuillermoCasalCaro

Thanks @GuillermoCasalCaro for the tip. I realized the fluent input components seem not to be doing this. I will check further with the versions and put up an update to set them if need be.

musale avatar Nov 21 '24 11:11 musale