Nova-Scotia-Digital-Service / service-pattern-library

4 stars 2 forks source link

Numeric fields #91

Open jamie-benoit opened 2 years ago

jamie-benoit commented 2 years ago

I think that we should have some guidance that when a field for a quantity or cost that the attribute mode should be numeric.

on pages:

  1. https://nova-scotia-digital-service.github.io/service-pattern-library/input-field-group.html image

2.https://nova-scotia-digital-service.github.io/service-pattern-library/phone-number.html image

  1. https://nova-scotia-digital-service.github.io/service-pattern-library/date-fields.html image
gabwhite commented 2 years ago

This is a good observation and something I'd like to add to the backlog once we get it going.

GDS has some good guidance on inputting numbers here. Basically, using ` can cause weird reactions in the browser.

There's also a good blog post from GDS on their solution, which is using, <input type="text" inputmode="numeric" pattern="[0-9]*">