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

Can't enter uppercase letters #8

Closed
annames opened this issue Jul 15, 2014 · 2 comments
Closed

Can't enter uppercase letters #8

annames opened this issue Jul 15, 2014 · 2 comments

Comments

@annames
Copy link

annames commented Jul 15, 2014

Hello,

I'm using your plugin with inputmask 3.0.55 on a form that allows grade entry for tests in a class. I have fields that must allow either a timed score (such as MM:SS format) or an "X" to indicate that a particular student did not complete the test. I am replacing long-standing code that did not work with IE 11 or Chrome, so there is a lot of data in the wild and many existing users who are familiar with this functionality and so I can't change it; I must allow a time (in a variety of user-selected formats) or an upper- or lowercase X.

This all works fine, and having multiple masks is very cool (thanks!), except that a couple of lines of event handling code in inputmask-multi are preventing me from entering uppercase letters.

In the mask function, lines 195 and 198 cause a "return true" if e.shiftKey is true... but that will be true even if the shift key is being held down in order to uppercase a letter. I changed that section of code to the following:

                    if (e.ctrlKey || k == opts.keyCode.SHIFT || e.altKey) {
                        return true;
                    }
                } else if (e.type == "keypress" && (e.ctrlKey || k == opts.keyCode.SHIFT || e.altKey)) {
                    return true;
                }

and it all works great. Without that change, the code exited before ever calling the keypressEvent function in inputmask, so my letter mask (with /[xX]/ validator) always failed for uppercase X (but worked fine for lowercase x).

Is this a reasonable change to make? Should the other key references here also use the opts.keyCode values or are they best left as they are?

Thanks,
Ann

@RobinHerbots
Copy link
Contributor

@annames ,

This is an issue for the jquery.inputmask. The file jquery.inputmask-multi.js has nothing todo with this project. This project only supports the earlier inputmask.

Can you open the same issue at https://github.com/RobinHerbots/jquery.inputmask

best regards,
Robin

RobinHerbots added a commit to RobinHerbots/Inputmask that referenced this issue Jul 15, 2014
andr-04/inputmask-multi#8

Note that jquery.inputmask-multi.js will be removed once the alternator syntax is mature enough.
@annames
Copy link
Author

annames commented Jul 16, 2014

Oh sure - sorry about that. I just posted it over there: RobinHerbots/Inputmask#574 .

@andr-04 andr-04 closed this as completed Jul 19, 2014
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

3 participants