Skip to content

Fix keyboard number type#2108

Closed
petrbela wants to merge 1 commit intonecolas:masterfrom
petrbela:fix-keyboard-number-type
Closed

Fix keyboard number type#2108
petrbela wants to merge 1 commit intonecolas:masterfrom
petrbela:fix-keyboard-number-type

Conversation

@petrbela
Copy link
Copy Markdown
Contributor

Numeric/decimal keyboardType should also set type=number to allow only numeric keys on desktop and mobile.

@petrbela
Copy link
Copy Markdown
Contributor Author

Related to numeric input, could RNW also support min, max and step? I know they don't exist in RN but they'd simply be ignore there. I can add it to this PR or create a separate one.

@necolas
Copy link
Copy Markdown
Owner

necolas commented Aug 22, 2021

See #1709

@petrbela
Copy link
Copy Markdown
Contributor Author

petrbela commented Aug 24, 2021

@necolas Fair enough. Would you be instead okay with adding web-only type, min, max, and step props to enable explicitly enforcing specific browser behavior when the developer chooses to do so?

@necolas
Copy link
Copy Markdown
Owner

necolas commented Aug 24, 2021

I don't think so, as that would puncture the API and allow completely different results to be produced on web.

You can either implement that functionality cross platform in JS, or use the unstable_createElement API to create a custom web element using those props, and decide where to fork/recombine that with your RN code in your product.

@necolas necolas closed this Aug 24, 2021
@necolas
Copy link
Copy Markdown
Owner

necolas commented Aug 24, 2021

But this is a relevant issue for future xplat react APIs, as it surfaces more limitations of RN's TextInput API

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants