jaridmargolin / formatter.js

Format html inputs to match a specified pattern
http://firstopinion.github.io/formatter.js
2.48k stars 235 forks source link

Dot (.) Issue #27

Closed Chaisser closed 10 years ago

Chaisser commented 10 years ago

When i use my own regex

$.fn.formatter.addInptType('D', /[A-Za-z0-9.]/);

$('#web').formatter({ 'pattern': 'http://www.{{DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD}}', 'persistent': true });

Like this

When i start to type github.com for example it goes back right after c

In this case when i type directly github it becomes like this

github.omc

Can't solve this issue thank you

jaridmargolin commented 10 years ago

The period is being interpreted as a delete key

KeyPress

".": { "which": 46, "keyCode": 46 } Firefox Only "delete": { "which": 0, "keyCode": 46 }

KeyDown

"delete": { "which": 46, "keyCode": 46 }


I will have to update the isDelKey method to distinguish between keypress and keydown. It also appears that due to how Firefox handles specialkeys, I will need to distinguish between which and keyCode. Due to current availability, I may not be able to submit a patch until early next week (at the earliest). Thanks for your patience.

denisson commented 10 years ago

@jaridmargolin, Any news about this issue?

Great lib. Thank you

jaridmargolin commented 10 years ago

@denisson: Unfortunately I have not had the necessary bandwidth to complete this task. I can do my best to set aside some time this weekend, but I cannot make any promises.

Feel free to submit a PR :)

denisson commented 10 years ago

I'll try to investigate it tomorrow. Thanks for your attention.

jaridmargolin commented 10 years ago

Issue resolved in v0.1.3