jaridmargolin / formatter.js

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

resetPattern() - Doesn't remove previously applied pattern. #103

Open gregowahoo opened 7 years ago

gregowahoo commented 7 years ago

I'd like to just remove a pattern I previously applied without having to add a new pattern. The following does remove the previous pattern... if (formattedFirstDocNumber) { formattedFirstDocNumber.resetPattern('{{**}}'); }

but then the cursor thinks there are 50 characters in the text-box. I just want the text-box to behave like a normal text-box, pre formatterJs.

This doesn't work either... $('#contentModel_TaskData_FirstDocNumber').formatter().resetPattern();

maylortaylor commented 6 years ago

I'm having the same issue! How can i just reset the field? this works but it removes all my listeners.

            elem.removeEventListener("keydown");
            elem.removeEventListener("keypress");