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

Input enhancements - Supports other native input types #1553

Closed
daopk opened this issue Nov 9, 2021 · 4 comments · Fixed by #1576
Closed

Input enhancements - Supports other native input types #1553

daopk opened this issue Nov 9, 2021 · 4 comments · Fixed by #1576
Labels
feature request New feature or request

Comments

@daopk
Copy link

daopk commented Nov 9, 2021

This function solves the problem (这个功能解决的问题)

Use native input types (e.g. tel, email and url) to improve users' mobile typing experience

Expected API (期望的 API)

<n-input type="tel" />

or

<n-input :input-props="{type: 'tel'}" />
@github-actions github-actions bot added the feature request New feature or request label Nov 9, 2021
@daopk
Copy link
Author

daopk commented Nov 9, 2021

ACTUAL BEHAVIOR

Screen Shot 2021-11-10 at 00 35 14

@Sepush
Copy link
Collaborator

Sepush commented Nov 11, 2021

we provide a prop called input-props for native props it's type is HTMLInputAttributes you can use it
see the doc https://www.naiveui.com/zh-CN/os-theme/components/input#API
image

@Sepush
Copy link
Collaborator

Sepush commented Nov 11, 2021

I give it a try but I found there is a problem when we use input-props="{type:'tel'}" the type still type:"text" is the default value of props type
image

maybe we should filter it when we use input-pops
What do you think of it? @07akioni

@07akioni
Copy link
Collaborator

I give it a try but I found there is a problem when we use input-props="{type:'tel'}" the type still type:"text" is the default value of props type image

maybe we should filter it when we use input-pops What do you think of it? @07akioni

I think we can make it override the default type. However we should make caveat in API table about it.

07akioni pushed a commit that referenced this issue Nov 14, 2021
* fix(#1553):`input-props` override the props

* fix:remove char
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants