Unlike other browsers, Safari triggers composition events in a different order. Consider the code below and following scenario:
- Having some input that triggers composition mode (say, some of Chinese input mode) and press "a".
- 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条)