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

Number input never renders the placeholder #144

Open
havelock opened this issue Feb 8, 2018 · 1 comment
Open

Number input never renders the placeholder #144

havelock opened this issue Feb 8, 2018 · 1 comment

Comments

@havelock
Copy link

havelock commented Feb 8, 2018

It seems impossible to see the placeholder for the <Number /> input element.

Whenever initialValue/defaultValue props are passed 0, null, undefined or even "" values the value="0" HTML attribute is always rendered.

The only solution for displaying the placeholder is passing value="" prop, but obviously the prop doesn't use the built-in onChange handling then and becomes non-editable.

<Number
  name="somename"
  placeholder={"Test placeholder"}
/>
@MartynasZilinskas
Copy link

Hey @havelock. <Number /> is a tricky component. At the moment it does not accept placeholder prop. The problem is with how Modifiers work. I'd recommend you to use <Text /> instead and parse it into number you need (e.g. parseInt).

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

No branches or pull requests

2 participants