tyler-technologies-oss / forge

Framework agnostic Web Component library that implements the Tyler Forge™ design system.
Apache License 2.0
44 stars 12 forks source link

[text-field] provide autofill styles #374

Closed DRiFTy17 closed 3 months ago

DRiFTy17 commented 1 year ago

Describe the bug: It's common for browsers to autofill <input> elements in forms. Currently the Forge text-field does not provide any overrides to the browser defaults, which makes it look a bit strange, especially when used with a <textarea>.

To Reproduce: Steps to reproduce the behavior:

  1. View a form using a Forge text-field (w/input & w/textarea) that has autofilled data in it
  2. Observe styles the misaligned autofill styles from the browser defaults.

Expected behavior: The autofill styles should properly cover the whole text-field, and inherit the custom styles that Forge provides for text-fields.

Here is an example of styles that can be used externally to make it look proper:

*:-webkit-autofill {
  border-radius: 3px;
}

textarea {
  min-height: 70px;
}

textarea:-webkit-autofill {
  margin: 0;
  padding: 24px 12px 3px;
}

forge-text-field::part(container) {
  padding-right: 0;
}
DRiFTy17 commented 1 year ago

For testing, this can be replicated in Chrome easily by adding some autofill data in the Chrome settings for a name, address, and phone number along with an HTML <form method="post" autocomplete="on"> including autocomplete attributes on each of the form fields.

DRiFTy17 commented 3 months ago

Fixed in 3.0 and supported by default