Skip to content

Add a formatter feature to input similar to input-number #553

@jimvandervoort

Description

@jimvandervoort
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

I often want to add some formatting to my text inputs to e.g trim whitespaces or capitalise the first letter of an input.

This improves end user experience because they can immediately see how their values will actually be parsed and edit their input if required.

I don't believe we'll need to implement a parser since input components don't need to convert from String to Number.

What does the proposed API look like?

Formatter would be identical to input-number:

<template>
  <a-input
    placeholder="First name"
    v-model="lastname"
    formatter="value => value.trim"
  >
</template>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions