Skip to content

Commit 12a5f49

Browse files
fix(Safari): Event execution sequence(en)
1 parent 453e59b commit 12a5f49

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.dumi/hooks/useIsSafari.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const useIsSafari = (): boolean => {
22
const ua = navigator.userAgent;
33

4-
// 基于 UA 判断(去除 ChromeCriOSFxiOS 等)
4+
// Determine based on UA (excluding Chrome, CriOS, FxiOS, etc.)
55
const isSafariUA =
66
ua.includes('Safari') &&
77
!ua.includes('Chrome') &&

components/sender/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ const ForwardSender = React.forwardRef<SenderRef, SenderProps>((props, ref) => {
221221
};
222222

223223
const onInternalCompositionEnd = () => {
224-
// Safari 修复:由于事件执行顺序差异,Safari会在onInternalCompositionStart后立马执行此函数,需要在按键事件中重置组合状态
224+
// Safari fix: Due to event execution order differences
225+
// Safari executes this function immediately after onInternalCompositionStart, requiring composition state reset in key events
225226
if (isSafari) {
226227
return;
227228
}
@@ -247,7 +248,7 @@ const ForwardSender = React.forwardRef<SenderRef, SenderProps>((props, ref) => {
247248
}
248249
break;
249250
}
250-
// Safari 修复:由于事件执行顺序差异,需要在按键事件中重置组合状态
251+
// Safari fix: Due to event execution order differences, composition state needs to be reset in key events
251252
if (isSafari) {
252253
isCompositionRef.current = false;
253254
}

0 commit comments

Comments
 (0)