From 59e6af3877d9965fde0e34898e7f62c59757a2ed Mon Sep 17 00:00:00 2001 From: jinghui Date: Tue, 17 Nov 2026 23:06:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8):=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E8=BE=93=E5=85=A5=E6=A1=86=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=96=E5=8F=AF=E7=BC=96=E8=BE=91=E2=80=94=E2=80=94?= =?UTF-8?q?hover/=E8=81=9A=E7=84=A6=E4=B8=BB=E8=89=B2=E6=8F=8F=E8=BE=B9+?= =?UTF-8?q?=E5=9B=9E=E8=BD=A6=E7=A1=AE=E8=AE=A4+=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=85=A8=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/workspace/draft/Draft.tsx | 7 ++++++ src/pages/workspace/draft/styles.module.less | 24 +++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/draft/Draft.tsx b/src/pages/workspace/draft/Draft.tsx index 4c93601..c7a2c1e 100644 --- a/src/pages/workspace/draft/Draft.tsx +++ b/src/pages/workspace/draft/Draft.tsx @@ -115,9 +115,16 @@ export default function Draft(props: IProps) { { + 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; diff --git a/src/pages/workspace/draft/styles.module.less b/src/pages/workspace/draft/styles.module.less index 27dd7e6..b5a0010 100644 --- a/src/pages/workspace/draft/styles.module.less +++ b/src/pages/workspace/draft/styles.module.less @@ -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 {