Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefill .fieldName for specialized inputs #1940

Open
tlouisse opened this issue Mar 15, 2023 · 0 comments
Open

Prefill .fieldName for specialized inputs #1940

tlouisse opened this issue Mar 15, 2023 · 0 comments

Comments

@tlouisse
Copy link
Member

tlouisse commented Mar 15, 2023

We should prepopulate the .fieldName property for specialized inputs, so that we get more sensible validation feedback messages.

Curent behavior

Given this html:

html`<lion-input-iban label="Mein Etikett"></lion-input-iban>`

🤷 This results in error message: 'Geben Sie eine gültige Mein Etikett ein.',

Desired behavior

Better would be, when we give input-iban a default fieldName:

export class LionInputIban extends LionInput {
   // ....
   
   get fieldName() {
     return 'Iban'; // this would be localized for all locales
   }
}

✅ Now the error msg will be: 'Geben Sie eine gültige Iban ein.'
See #1938

Inputs involved

We can apply this for all these inputs:

  • input-amount => 'amount'
  • input-date => 'date' (this makes it also apply to input-datepicker)
  • input-email => 'email'
  • input-iban => 'IBAN'
  • input-tel => 'telephone number' (this makes it also apply to input-tel-dropdown)
  • input-range?
  • input-stepper?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant