Skip to content

[css-text] Provide CSS support for automatic spacing (or other separators) in text input field #4875

@marvindanig

Description

@marvindanig

This is a feature request to allow styling of the text input field for formatted inputs like credit card or date or phone number with an area code. Currently this is not possible without using javascript.

Shown below is an example where a credit card number is split into groupings of four digits each:

image

In general, people tend to use comma separation or spaces between large numbers (like a credit card) to pin for accuracy of input. So in some ways this is an accessibility issue as well.

At this point all of the solutions out there require using javascript to format the inputted string by listening to the onblur event. There are even libraries from large providers to style the information fields such as this one from Stripe. Linked here is the Twitter thread that prompted this proposal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions