mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-05-16 17:37:40 +08:00
- 工具中心新增 AI 聊天发送快捷键,默认 Enter 并支持 Ctrl/Cmd/Alt+Enter - AI 输入框按录制绑定发送,保留 Shift+Enter 换行和输入法 composing 保护 - 修复 shortcutOptions 启动刷新覆盖录制值的问题,并校验脏持久化快捷键 - 补充快捷键、输入框提示和持久化回归测试 - 撤回 macOS Caps Lock 浮层无效前端规避,恢复输入控件 no-auto-cap 属性 - 新增需求进度追踪文档记录验证结果
27 lines
777 B
TypeScript
27 lines
777 B
TypeScript
export const noAutoCapInputProps = {
|
|
autoCapitalize: 'none' as const,
|
|
autoCorrect: 'off' as const,
|
|
spellCheck: false,
|
|
};
|
|
|
|
export const applyNoAutoCapAttributes = (element: Element) => {
|
|
const tagName = String((element as Element | null)?.tagName || '').toUpperCase();
|
|
if (tagName !== 'INPUT' && tagName !== 'TEXTAREA') {
|
|
return;
|
|
}
|
|
|
|
element.setAttribute('autocapitalize', 'none');
|
|
element.setAttribute('autocorrect', 'off');
|
|
element.setAttribute('spellcheck', 'false');
|
|
};
|
|
|
|
export const applyNoAutoCapAttributesWithin = (root: ParentNode | null | undefined) => {
|
|
if (!root || typeof root.querySelectorAll !== 'function') {
|
|
return;
|
|
}
|
|
|
|
root.querySelectorAll('input, textarea').forEach((element) => {
|
|
applyNoAutoCapAttributes(element);
|
|
});
|
|
};
|