Closed AdrianNigro closed 2 years ago
the problem: It seems that chrome doesn't respect the autocomplete = 'off' attribute
autocomplete = 'off'
our workarround: in our project we are assigning to the autocomplete attribute the value "none" so that it works well in chrome
the improvement in the component: to make this component work we were forced to download it and modify it to get the desired attributes.
Our solution was to add this line to the input declaration:
{...$$restProps}
and the code is like this:
<input type="text" class="{inputClassName ? inputClassName : ''} {noInputStyles ? '' : 'input autocomplete-input'}" id={inputId ? inputId : ""} autocomplete={html5autocomplete ? "on" : "off"} {placeholder} {name} {disabled} {required} {title} readonly={readonly || (lock && selectedItem)} {tabindex} bind:this={input} bind:value={text} on:input={onInput} on:focus={onFocusInternal} on:blur={onBlurInternal} on:keydown={onKeyDown} on:click={onInputClick} on:keypress={onKeyPress} {...$$restProps} />
Please, consider adding this line of code to expose any other attribute that it wants to modify from the outside without having to modify the component code.
Added suggested $$restProps but also value to controll the off value autocompleteOffValue
autocompleteOffValue
Great thanks!
the problem: It seems that chrome doesn't respect the
autocomplete = 'off'
attributeour workarround: in our project we are assigning to the autocomplete attribute the value "none" so that it works well in chrome
the improvement in the component: to make this component work we were forced to download it and modify it to get the desired attributes.
Our solution was to add this line to the input declaration:
{...$$restProps}
and the code is like this:
Please, consider adding this line of code to expose any other attribute that it wants to modify from the outside without having to modify the component code.