Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 4d26abc

Browse files
authored
fix: a11y rule "no-noninteractive-element-interactions" (#4163)
1 parent a79af85 commit 4d26abc

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

components/atoms/Fab/fab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface FabProps extends React.HTMLAttributes<HTMLButtonElement> {
55
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
66
onClick?: () => void;
77
}
8-
const Fab = ({ position, children, className }: FabProps) => {
8+
const Fab = ({ position, children, className, onClick }: FabProps) => {
99
const getFabPositionStyles = () => {
1010
switch (position) {
1111
case "top-left":
@@ -21,7 +21,7 @@ const Fab = ({ position, children, className }: FabProps) => {
2121
}
2222
};
2323
return (
24-
<button type="button" className={clsx("fixed", getFabPositionStyles(), className)}>
24+
<button type="button" onClick={onClick} className={clsx("fixed", getFabPositionStyles(), className)}>
2525
{children}
2626
</button>
2727
);

components/molecules/HighlightInput/highlight-input-form.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -754,14 +754,13 @@ const HighlightInputForm = ({ refreshCallback }: HighlightInputFormProps): JSX.E
754754
}`}
755755
/>
756756
)}
757-
<p
758-
className="text-light-slate-11 truncate max-w-[14rem] xs:max-w-[16rem] text-xs xs:text-sm cursor-pointer hover:text-orange-600 transition"
759-
onClick={() => {
760-
window.open(suggestion.url, "_blank");
761-
}}
757+
<a
758+
href={suggestion.url}
759+
target="_blank"
760+
className="truncate max-w-[14rem] xs:max-w-[16rem] text-xs xs:text-sm"
762761
>
763762
{suggestion.title}
764-
</p>
763+
</a>
765764
</div>
766765
<Tooltip className="text-xs modal-tooltip" direction="top" content="Fill content">
767766
<button
@@ -1023,14 +1022,14 @@ const HighlightInputForm = ({ refreshCallback }: HighlightInputFormProps): JSX.E
10231022
</form>
10241023
)}
10251024

1026-
<Fab className="md:hidden">
1027-
<div
1028-
onClick={() => setIsFormOpenMobile(true)}
1029-
className="p-3 mb-10 -mr-4 text-white rounded-full shadow-lg bg-light-orange-10"
1025+
<Fab className="md:hidden" onClick={() => setIsFormOpenMobile(true)}>
1026+
<span
1027+
className="outline-none p-3 mb-10 -mr-4 text-white rounded-full shadow-lg bg-light-orange-10"
10301028
id="mobile-highlight-create"
10311029
>
1030+
<span className="sr-only">Create a highlight</span>
10321031
<RxPencil1 className="text-3xl" />
1033-
</div>
1032+
</span>
10341033
</Fab>
10351034
</>
10361035
);

0 commit comments

Comments
 (0)