mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-03 04:59:46 +08:00
🐛 fix(frontend): 修复 Redis 搜索匹配与输入交互体验
- Redis Key 搜索默认补全包含匹配并支持 ASCII 大小写不敏感 - Redis 标签页增加连接名与 host 摘要,区分同名 db 标签 - 抽取 inputAutoCap、redisSearchPattern、tabDisplay 共享工具并补充回归测试 - 覆盖连接配置、Redis 搜索、表设计、表概览和数据表筛选输入的自动纠正问题 - 在 macOS 文本输入面板关闭局部毛玻璃,修复输入法切换出现透明框
This commit is contained in:
26
frontend/src/utils/inputAutoCap.ts
Normal file
26
frontend/src/utils/inputAutoCap.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user