mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 14:24:15 +08:00
fix(kline): blur focused control after arrow-key switching to drop stray focus ring
点过分时tab/外链等控件后方向键切股, 浏览器会给该已聚焦控件显示 focus-visible 默认蓝色 outline(应用未自定义 focus 样式, 即浏览器默认环)。 切股成功后 blur 掉当前聚焦元素, 一次覆盖弹窗内所有控件。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -224,7 +224,12 @@ export function StockPreviewDialog({ symbol, name, onClose, triggerInfo, navList
|
||||
const t = e.target as HTMLElement | null
|
||||
if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.tagName === 'SELECT' || t.isContentEditable)) return
|
||||
if (showMonitorEditor) return
|
||||
if (go(e.key === 'ArrowRight' ? 1 : -1)) e.preventDefault()
|
||||
if (go(e.key === 'ArrowRight' ? 1 : -1)) {
|
||||
e.preventDefault()
|
||||
// 切股后清掉控件残留的键盘焦点: 点过分时tab/外链等控件后方向键切股,
|
||||
// 浏览器会给该控件显示 focus-visible 默认蓝色 outline, 切换后 blur 掉避免残留
|
||||
;(document.activeElement as HTMLElement | null)?.blur()
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener('keydown', handler)
|
||||
|
||||
Reference in New Issue
Block a user