Skip to content

Input Formatting numeric keyboard characters are not being accepted #1

@AdrianNigro

Description

@AdrianNigro

Hello, I know that the book code is educational and for this purpose it is kept to a minimum.
Anyway I leave this comment

at book page 61 "Input formatting" numeric keyboard characters are not being accepted.

if (keyCode != 46 && (keyCode < 48 || keyCode > 57)) e.preventDefault();

the numeric keyboard code range is 96 - 105 and the code should be

if (keyCode != 46 && (keyCode < 48 || keyCode > 57) && (keyCode < 96 || keyCode > 105) ) e.preventDefault();

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