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

Allow only numbers in dial mode #147

Open
jfc-ddev opened this issue May 21, 2024 · 13 comments
Open

Allow only numbers in dial mode #147

jfc-ddev opened this issue May 21, 2024 · 13 comments

Comments

@jfc-ddev
Copy link

In the latest version it was found:

  • When a character is entered, it no longer detects backspace and the entered value cannot be deleted.

  • It is still allowed to write characters other than numbers.

image

Tip: You could try adding a regex to apply event.preventDefault() when it is verified that it is not a digit.

Greetings

@dhutaryan
Copy link
Owner

Are you sure you updated the version? I checked that button as well. Open the docs and try there. As I see everything works as expected.

@jfc-ddev
Copy link
Author

jfc-ddev commented May 21, 2024

Yes, I have version 17.4.1 installed. I'm trying in the dial mode of the documentation, and it lets me enter chars 🤯

(https://dhutaryan.github.io/ngx-mat-timepicker/#/usage)

image

@dhutaryan
Copy link
Owner

How do you do it? Maybe cache? Because I can't enter anything else except number.

@jfc-ddev
Copy link
Author

image

I hold down the shift key + one of the following keys [ ] } { -

@dhutaryan
Copy link
Owner

I've tried a lot of combinations on mac and windows and couldn't reproduce it. Did you clean browser cache?

@jfc-ddev
Copy link
Author

jfc-ddev commented May 21, 2024

Yes, I did it but the bug is persistent

@dhutaryan
Copy link
Owner

I figure it out. This is some specific behaviour for Spanish keyboard. It ignores preventDefault for some reason. Even numeric value check doesn't work. Not sure it will be fixed, at least for now.

@jfc-ddev
Copy link
Author

Did you try using a regular expression to allow only numbers and then using a preventDefault?

@dhutaryan
Copy link
Owner

Yes, I did. It didn't help as I remember.

@jfc-ddev
Copy link
Author

jfc-ddev commented Jun 1, 2024

Hi

Do you have any news?

@dhutaryan
Copy link
Owner

Nope. I believe the most important is that you cannot apply non-numbers. The fact you can enter into the fields some tricky value that will be replaced on blur is not a big deal.

@jfc-ddev
Copy link
Author

Hi

Do you have any news?

@dhutaryan
Copy link
Owner

@jfc-ddev nope. Now the exact value is checking and it doesn't work even in this case. There is a magic with Spanish keyboard. Not sure it will be fixed someday.
Anyway, as I said before, the most important that invalid value will be changed to valid after blur.

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

2 participants