javascript - Safari: Is there's any way to detect that this particular keydown event triggered compositionend? - Stack O

Unlike other browsers, Safari triggers composition events in a different order. Consider the code below

Unlike other browsers, Safari triggers composition events in a different order. Consider the code below and following scenario:

  1. Having some input that triggers composition mode (say, some of Chinese input mode) and press "a".
  2. When the composition input dialog is shown, click some number, say, 4

Events in Chrome and Firefox will happen in following order:

[keydown] key: a; currently in composing mode: false
[compositionstart] data: 
[compositionupdate] data: 
[keydown] key: 4; currently in composing mode: true
[compositionend] data: 呵

In Safari, however, the keydown that triggers compositionend will happen later, after the corresponding composition has been triggered, so the order will be:

[compositionstart] data: 
[compositionupdate] data: 
[keydown] key: a; currently in composing mode: true
[compositionend] data: 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744780718a4593322.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信