After playing with him more, I was able to come up with a solution that I am pleased with. I thought that I would share something that someone was curious:
Plunkr: http://embed.plnkr.co/gE1WXaXsYI7zpWPkmvVS/preview
Basically, I came across the properties "selectionStart" and "selectionEnd" of an element that allows you to capture an index at which a new value will be inserted at the click of a button. Thus, I was able to get a "new value", so to speak, taking the old value and inserting the character entered in the correct position, confirm it and we will not allow pressing the "invalid" key.
Another thing I did differently was to exclude all the slashes and spaces that the masking inserted (_ _ / _ _ / _ _ _ _) and changed my regex only for checking based on numbers (for example, " 12121900 ") which allows the user to return / insert characters at any time without getting the strange" 123/19/90 "variations of the options that fail.
It's not quite perfect, but better, at least.
source share