Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Add Inputmode for tel and email (identities)#1384

Merged
Hinton merged 1 commit into
bitwarden:masterfrom
coliff:patch-1
Jan 12, 2022
Merged

Add Inputmode for tel and email (identities)#1384
Hinton merged 1 commit into
bitwarden:masterfrom
coliff:patch-1

Conversation

@coliff
Copy link
Copy Markdown
Contributor

@coliff coliff commented Jan 10, 2022

helps improve the UX for users with virtual keyboards (mobile devices and tablets

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Helps improve the UX for users with virtual keyboards (mobile devices and tablets).

Code changes

This PR supercedes: #661

I wrote about inputmode for CSS Tricks:
https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/#aa-tel
https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/#aa-email

Before you submit

  • I have checked for linting errors (npm run lint) (required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

helps improve the UX for users with virtual keyboards (mobile devices and tablets
@Hinton Hinton self-assigned this Jan 10, 2022
@Hinton
Copy link
Copy Markdown
Member

Hinton commented Jan 10, 2022

@danielleflinn Any thoughts from the design aspects? My primary concern is that it won't be possible to input non-numeric characters in the phone input. But I'm not sure why anyone would do that in the first place.

I took a look at our mobile app, and inputmode for email seems to be email, but text for phone.

@danielleflinn
Copy link
Copy Markdown

It is a standard UX pattern to restrict input for a phone field to just numbers. The only potential concern I can think of is I don't believe we are formatting that field currently so any entry would be difficult to read since it'd show up as "5554443333".

Ideally we'd format the input number automatically to "555-444-3333"; however being an international product, this introduces it's own challenges in identifying what phone number format to use by region.

All in all, I do agree that only allowing numerical digits in the phone fields does improve the experience even without the ability to format the numbers.

@djsmith85
Copy link
Copy Markdown
Contributor

We could use https://github.com/google/libphonenumber for parsing and formatting. There's also a port of it in C# which could be used on mobile.

@Hinton
Copy link
Copy Markdown
Member

Hinton commented Jan 12, 2022

@djsmith85 Difficult thing is figuring out what region a number is for. (I guess we have a country field in identity that could be used for displaying though)

@Hinton Hinton changed the title inputmode for tel and email Add Inputmode for tel and email (identities) Jan 12, 2022
@Hinton Hinton merged commit b8de924 into bitwarden:master Jan 12, 2022
@Hinton
Copy link
Copy Markdown
Member

Hinton commented Jan 12, 2022

Merged, thanks for the contribution @coliff.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants