Skip to content

Commit 5192b10

Browse files
committed
feat: add clear button to CVE report search field
1 parent a27fd6e commit 5192b10

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/pages/ScanReportPage.module.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
.search {
8989
width: 100%;
90-
padding: 9px 12px 9px 38px;
90+
padding: 9px 34px 9px 38px;
9191
background: var(--bg-card);
9292
border: 1px solid var(--border-strong);
9393
border-radius: 8px;
@@ -101,6 +101,22 @@
101101
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
102102
.search::placeholder { color: var(--text-secondary); }
103103

104+
.clearBtn {
105+
position: absolute;
106+
right: 10px;
107+
top: 50%;
108+
transform: translateY(-50%);
109+
background: none;
110+
border: none;
111+
padding: 0 2px;
112+
font-size: 16px;
113+
line-height: 1;
114+
color: var(--text-secondary);
115+
cursor: pointer;
116+
transition: color 0.1s;
117+
}
118+
.clearBtn:hover { color: var(--text-primary); }
119+
104120
.filterBtns { display: flex; gap: 8px; }
105121

106122
.fbtn {

src/pages/ScanReportPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ export function ScanReportPage() {
162162
onChange={e => setQuery(e.target.value)}
163163
autoComplete="off"
164164
/>
165+
{query && (
166+
<button className={styles.clearBtn} onClick={() => setQuery('')} aria-label="Clear search">×</button>
167+
)}
165168
</div>
166169
<div className={styles.filterBtns}>
167170
{(['all', 'vuln', 'clean'] as Filter[]).map(f => (

0 commit comments

Comments
 (0)