@@ -10,15 +10,22 @@ interface TagFilterProps {
1010 onTagsChange : ( tags : string [ ] ) => void ;
1111}
1212
13- export default function TagFilter ( { tags, selectedTags, onTagsChange } : TagFilterProps ) {
13+ export default function TagFilter ( {
14+ tags,
15+ selectedTags,
16+ onTagsChange,
17+ } : TagFilterProps ) {
1418 const [ filterInput , setFilterInput ] = useState ( "" ) ;
1519 const [ isDropdownOpen , setIsDropdownOpen ] = useState ( false ) ;
1620 const dropdownRef = useRef < HTMLDivElement > ( null ) ;
1721 const inputRef = useRef < HTMLInputElement > ( null ) ;
1822
1923 useEffect ( ( ) => {
2024 function handleClickOutside ( event : MouseEvent ) {
21- if ( dropdownRef . current && ! dropdownRef . current . contains ( event . target as Node ) ) {
25+ if (
26+ dropdownRef . current &&
27+ ! dropdownRef . current . contains ( event . target as Node )
28+ ) {
2229 setIsDropdownOpen ( false ) ;
2330 }
2431 }
@@ -46,7 +53,11 @@ export default function TagFilter({ tags, selectedTags, onTagsChange }: TagFilte
4653 } ;
4754
4855 const handleKeyDown = ( e : React . KeyboardEvent ) => {
49- if ( e . key === "Backspace" && filterInput === "" && selectedTags . length > 0 ) {
56+ if (
57+ e . key === "Backspace" &&
58+ filterInput === "" &&
59+ selectedTags . length > 0
60+ ) {
5061 removeTag ( selectedTags [ selectedTags . length - 1 ] ) ;
5162 }
5263 } ;
@@ -105,7 +116,9 @@ export default function TagFilter({ tags, selectedTags, onTagsChange }: TagFilte
105116 className = "absolute z-20 top-full left-0 right-0 mt-2 bg-dash-surface border border-dash-border rounded-xl shadow-xl max-h-60 overflow-y-auto"
106117 >
107118 { availableTags . length === 0 ? (
108- < div className = "p-4 text-gray-500 text-center" > No matching tags found</ div >
119+ < div className = "p-4 text-gray-500 text-center" >
120+ No matching tags found
121+ </ div >
109122 ) : (
110123 availableTags . map ( ( tag ) => (
111124 < button
0 commit comments