Lundalogik / lime-elements

Provides reusable web components for Lime CRM
https://lundalogik.github.io/lime-elements/versions/latest
Other
38 stars 11 forks source link

Disable autocomplete in pickers #3177

Open eketorp opened 1 day ago

eketorp commented 1 day ago

This is super annoying:

Image

Image

I think we should disable auto complete in pickers in CRM. And maybe in text fields as well. Auto complete is meant for entering your email and name into ordering forms and such. Not Ticket descriptions and Deal names. I do not see any good use of autocomplete in CRM.

According to a friend:

To prevent Microsoft Edge from showing autocomplete suggestions in your web app’s forms, you can use the autocomplete attribute in your HTML input elements. Setting this attribute to “off” can help you control where autocomplete is applied. Here’s how you can do it:

HTML Example

<form>
  <input type="text" name="username" autocomplete="off">
  <input type="password" name="password" autocomplete="off">
  <!-- For fields that look like input boxes but are actually menus -->
  <input type="text" name="menu" autocomplete="off">
</form>

JavaScript Example If you need to dynamically set this attribute using JavaScript, you can do something like this:

document.querySelectorAll('input').forEach(input => {
  input.setAttribute('autocomplete', 'off');
});

CSS Example In case you want to visually differentiate these fields, you can use CSS:

input[autocomplete="off"] {
  border: 1px solid red; /* Just an example to highlight */
}
eketorp commented 1 day ago

Please note that this autocomplete pops up just about everywhere. Image Image Image