admin管理员组

文章数量:1392076

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: 

本文标签: