bitovi / syn

Standalone Synthetic Event Library
https://www.npmjs.com/package/syn
MIT License
444 stars 259 forks source link

Add the “key” property to events #180

Closed chasenlehara closed 4 years ago

chasenlehara commented 4 years ago

Syn currently emits events with the which property, which has been deprecated in favor of the key property.

Syn sets which here: https://github.com/bitovi/syn/blob/37814415f59a3e8b75770d5dd010263d8d63963a/src/key.js#L404-L409

cherifGsoul commented 4 years ago

https://github.com/bitovi/syn/blob/cb614a64bf7947b4fb86c5d45cbc38a94ae45efd/src/key.js#L743 key property is readonly, the created event in the line above will be without key property on firefox. To fix this it seems the event should be created with KeyboardEvent constructor.

None of IE versions support this event constructor.