Skip to content

Number inputs don't accept zeros from a direct input #64

@joonaspaakko

Description

@joonaspaakko

Basically, you can't insert zeros using the input field in <gb-input-numeric/> making it so you can't really input any number that contains a 0. The issue is reproducible the number inputs at vuedarkmode website. Try to input 100, for instance.

Users can technically get around it by for example inputting 9 and then click the plus to make it 10. Although that is kind of a bad example if the value starts from 0, because you can insert caret in front of the 0 and input 1.

If I had to throw in a wild guess, I'd say this was perhaps done on purpose to avoid leading zeros but it ended up doing more than that.

P.S. I'm also not super happy with how text selection has no background color in number inputs. Easily overridable, but still...

P.P.S. I tried to link directly to the number inputs in the docs: https://www.growthbunker.dev/vuedarkmode/#fieldInputNumeric but I guess since there's an "auto focus" on the newsletter input, it's not possible because it jumps to the top. This was happening in Chrome (v.91.0.4472.77) but interestingly not in Firefox (v.89.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions