Skip to content

Commit 94468eb

Browse files
apply code quality fixes
1 parent 44d50d5 commit 94468eb

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

frontend/src/components/ProgramActions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ const ProgramActions: React.FC<ProgramActionsProps> = ({ status, setStatus }) =>
133133
{dropdownOpen && (
134134
<div
135135
role="menu"
136+
tabIndex={0}
136137
onKeyDown={handleMenuKeyDown}
137138
className="absolute right-0 z-20 mt-2 w-40 rounded-md border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800"
138139
>

frontend/src/components/Search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ const SearchBar: React.FC<SearchProps> = ({
8585
onChange={handleSearchChange}
8686
placeholder={placeholder}
8787
className="h-12 w-full rounded-lg border-1 border-gray-300 pr-10 pl-10 text-lg text-black focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-hidden dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:focus:border-blue-300 dark:focus:ring-blue-300"
88-
aria-label={placeholder || 'Search'}
8988
/>
9089
{searchQuery && (
9190
<button
91+
type="button"
9292
aria-label="Clear search"
9393
className="absolute top-1/2 right-2 -translate-y-1/2 rounded-full p-1 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-300 focus-visible:ring-offset-1"
9494
onClick={handleClearSearch}

frontend/src/components/ShowMoreButton.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ const ShowMoreButton = ({ onToggle }: { onToggle: () => void }) => {
1616
<Button
1717
type="button"
1818
disableAnimation
19-
onKeyDown={(e: React.KeyboardEvent) => {
20-
if (e.key === 'Enter' || e.key === ' ') {
21-
e.preventDefault()
22-
handleToggle()
23-
}
24-
}}
19+
onPress={handleToggle}
2520
aria-expanded={isExpanded}
2621
aria-label={isExpanded ? 'Show less items' : 'Show more items'}
2722
className="flex items-center bg-transparent px-0 text-blue-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-offset-1"

frontend/src/components/ToggleableList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const ToggleableList = ({
3939
{(showAll ? items : items.slice(0, limit)).map((item) => (
4040
<button
4141
key={item}
42+
type="button"
4243
aria-label={`Search projects for ${item}`}
4344
className="rounded-lg border border-gray-400 px-3 py-1 text-sm hover:bg-gray-200 dark:border-gray-300 dark:hover:bg-gray-700 focus:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 transition"
4445
onClick={() => !isDisabled && handleButtonClick({ item })}

0 commit comments

Comments
 (0)