mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
fix: 优化自动刷新交互和ESC关闭样式
- 自动刷新改为按钮切换模式,移除独立Switch开关 - 自动刷新间隔从30s改为10s - ESC关闭弹窗后blur焦点,避免样式残留
This commit is contained in:
@@ -45,6 +45,11 @@ export function useEscapeKey(
|
||||
// 执行回调
|
||||
callback()
|
||||
|
||||
// 移除当前元素的焦点,避免残留样式
|
||||
if (document.activeElement instanceof HTMLElement) {
|
||||
document.activeElement.blur()
|
||||
}
|
||||
|
||||
// 如果只监听一次,则移除监听器
|
||||
if (once) {
|
||||
removeEventListener()
|
||||
|
||||
Reference in New Issue
Block a user