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

Uppercase not working #167

Closed
emielmolenaar opened this issue Mar 7, 2017 · 2 comments · Fixed by badsaarow/cleave.js#19
Closed

Uppercase not working #167

emielmolenaar opened this issue Mar 7, 2017 · 2 comments · Fixed by badsaarow/cleave.js#19

Comments

@emielmolenaar
Copy link

I am trying to get Cleave working to convert some fields to uppercase, but unfortunately I can not get it to work.

Please see one of the examples at https://jsfiddle.net/nosir/kbaxx64s/ . For instance, I have changed the last call to:

// custom
var cleaveCustom = new Cleave('.input-custom', {
    uppercase: true
});

I would expect that after running the fiddle, any values typed in the .input-custom element will be converted to uppercase. But, they are not. Am I doing something wrong or is this a bug?

@nosir
Copy link
Owner

nosir commented Mar 25, 2017

Well, you will need to pass a mask block pattern as well, like [3, 3, ...] otherwise cleave.js would ignore it, that's where the lib's name comes from: cleave some stuff.

To make it work as you expected, you can pass [0, 9999] to it.

var cleaveCustom = new Cleave('.input-custom', {
    uppercase: true,
    blocks: [0, 9999]
});

Will close this for now.

@nosir nosir closed this as completed Mar 25, 2017
@sheriffderek
Copy link

I also expected uppercase to work with no blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants