ui-mask icon indicating copy to clipboard operation
ui-mask copied to clipboard

change event fires twice if I replace one selected symbol

Open andrymook opened this issue 8 years ago • 0 comments

I tested it in Chrome 54.0.2840.99 and Firefox 50.0. You can use other versions.

How to repeat:

  1. Open Mask HtmlPreview Page
  2. Open Developer Tools
  3. Add "change" event for the first event: document.querySelector('input').addEventListener('change', function(event){ console.log(event); }); Or add "change" event for document.body: document.body.addEventListener('change', function(event){ console.log(event); });
  4. Select Predefined mask: for example, Set to (999) 999-9999
  5. Fill Masked Input field correctly: (123) 456-7890
  6. Now if you put cursor, for example, between symbols 7 and 8, then press Delete, then press 3: (123) 456-7390,
  • you can see only one event in console - Chrome 54.0.2840.99
  • you can see two events in console - Firefox 50.0 But if you select 8 (only one symbol) in "(123) 456-7890" mask_select8 and press 3,
  • you can see two events - Firefox 50.0 and Chrome 54.0.2840.99 mask_changetwice

andrymook avatar Jan 18 '17 17:01 andrymook