feat(项目列表): 项目名输入框可视化可编辑——hover/聚焦主色描边+回车确认+点击全选

This commit is contained in:
jinghui committed 2026-11-17 23:06:24 +08:00
1 parent adf10afda5
commit 59e6af3877
2 files changed
+30 -1

No files matched your search

+7
View File
@@ -115,9 +115,16 @@ export default function Draft(props: IProps) {
</a>
<input
title={language.val('draft_name_input')}
placeholder={language.val('draft_name_input')}
onKeyDown={e => {
if (e.key === 'Enter') e.currentTarget.blur();
e.stopPropagation();
}}
onFocus={e => {
currentName.current = e.target.value;
e.currentTarget.select();
}}
onClick={e => e.stopPropagation()}
onBlur={async e => {
if (e.target.value === currentName.current) return;
item.name = e.target.value;
+23 -1
View File
@@ -18,10 +18,32 @@
.name {
margin-top: 10px;
border: none;
border: 1px solid transparent;
width: 100%;
background: transparent;
color: var(--theme-text);
cursor: text;
border-radius: 6px;
padding: 4px 6px;
font-size: 14px;
line-height: 1.4;
transition: background 0.2s, border-color 0.2s;
&:hover {
background: var(--theme-wateritem);
border-color: var(--theme-main);
}
&:focus {
outline: none;
background: var(--theme-wateritem);
border-color: var(--theme-main);
}
&::placeholder {
color: var(--theme-text);
opacity: 0.5;
}
}
.pic {