-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
let size argument control dcc.Input of non-text types as well? #161
Comments
I found an example of validating an I'm also not having any luck figuring out how/why the P.S. In hindsight, I think I should have filed this at dash-core-components. Sorry about that and feel free to move, or I can re-file over there. |
Thanks for reporting @jwhendy ! Here's some context: the
Now, HTML is pretty idiosyncratic - sometimes these attributes work differently on different browsers (for example, I'd rather not override the behaviour of these properties like For this particular use case, I recommend passing in
I'll close this issue with that solution but feel free to reopen if this isn't working as you would like it. |
Thanks @chriddyp ! I ended up stumbling on this as well. It definitely did not dawn on me initially to use raw It seems all the valuable lessons happen when running into some oddity and having to struggle a bit. Now it will be fresher in my mind to look at using Thanks again! |
I'm using some
dcc.Input
elements in an app and would like the size of the box to be smaller. It should contain numbers, so my intuition was to usetype='number'
, but to my surprise I found I couldn't seem to control the width like withtype='text'
. From the docs it seems this might be expected, though the bold part below is unclear and reads like it might not have been completed:In my case, I like the
number
type as it prevents the user from entering text, but I only need it to hold 2-3 digits so I'd like it small so I can place side by side with another field.Would you advise I use
type='text'
and try thepattern
argument to ensure it's only digits? I haven't tried this yet, but I'm guessing I can do something like[0-9]{1,3}
or something. Per #160 I'm now thinking thetype
argument is purely to apply some checks to the input field, not to affect the return type in any way, sonumber
vs.text
is only advantageous to me with respect to not taking in strings.If it would be considered valuable, I personally vote that
size
should just apply to alldcc.Input
types.Thanks!
The text was updated successfully, but these errors were encountered: