Skip to content

Commit b667197

Browse files
authored
[KW-595] fix: QR 스캐너 UI 컴포넌트 수정 (#26)
* KW-595/feat: SearchBar에서 Enter 키 입력 시 검색 수행되도록 수정 * KW-595/fix: 테이블 row 클릭 시에도 항목 선택되도록 수정
1 parent 71e08ae commit b667197

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/components/searchbar/SearchBar.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ const SearchBar = ({ placeholder, onSearch }: SearchBarProps) => {
1414
if (onSearch) onSearch(inputValue);
1515
};
1616

17+
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
18+
if (e.key === 'Enter') {
19+
handleSearch();
20+
}
21+
};
22+
1723
return (
1824
<div className="search-bar">
1925
<input
@@ -22,6 +28,7 @@ const SearchBar = ({ placeholder, onSearch }: SearchBarProps) => {
2228
placeholder={placeholder}
2329
value={inputValue}
2430
onChange={(e) => setInputValue(e.target.value)}
31+
onKeyDown={handleKeyDown}
2532
/>
2633
<button className="search-bar-button" onClick={handleSearch}>
2734
검색

src/components/table/CheckTable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const CheckTable: React.FC<CheckEditTableProps> = ({ tableTitles, data, onRowSel
5252
<tr
5353
key={idx}
5454
className={selectedRow === idx ? "check-table-selected-row" : ""}
55+
onClick={() => handleRowSelect(idx)}
56+
style={{ cursor: 'pointer' }}
5557
>
5658
<td>
5759
<input

0 commit comments

Comments
 (0)