This commit is contained in:
张成
2025-11-16 09:53:24 +08:00
parent 6f4900eb0b
commit ad971796ba
8 changed files with 143 additions and 64 deletions

View File

@@ -32,9 +32,12 @@ const CancelPopup = forwardRef((props, ref) => {
show: (onAct) => {
onFinish.current = onAct;
setVisible(true);
setTimeout(() => {
inputRef.current && inputRef.current.focus();
}, 0);
// 使用 requestAnimationFrame 替代 setTimeout(0),性能更好
requestAnimationFrame(() => {
requestAnimationFrame(() => {
inputRef.current && inputRef.current.focus();
});
});
},
}));