ScottLogic / finput

A vanilla-JS financial amount input control
http://scottlogic.github.io/finput
MIT License
22 stars 10 forks source link

Pasting in IE11 not processed by finput #96

Closed ggovan closed 7 years ago

ggovan commented 7 years ago

Pasting in IE11 isn't processed by finput, this means numbers can be inserted in the middle of existing values, and illegal characters can be inserted.


To repeat:

On a finput element with 1,234.00 with the cursor after 2 paste bob5678

Expected:

1,234.00

Actual:

12,bob,567,834.00


The paste event object in IE11 isn't a ClipboardEvent but a DragEvent. This event doesn't have the clipboardData property instead the data can be retrieved from window.clipboardData

This seems to be the case for IE5+. Works in Edge.