Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: a11y rule "no-noninteractive-element-interactions" #4163

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/atoms/Fab/fab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface FabProps extends React.HTMLAttributes<HTMLButtonElement> {
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
onClick?: () => void;
}
const Fab = ({ position, children, className }: FabProps) => {
const Fab = ({ position, children, className, onClick }: FabProps) => {
const getFabPositionStyles = () => {
switch (position) {
case "top-left":
Expand All @@ -21,7 +21,7 @@ const Fab = ({ position, children, className }: FabProps) => {
}
};
return (
<button type="button" className={clsx("fixed", getFabPositionStyles(), className)}>
<button type="button" onClick={onClick} className={clsx("fixed", getFabPositionStyles(), className)}>
{children}
</button>
);
Expand Down
21 changes: 10 additions & 11 deletions components/molecules/HighlightInput/highlight-input-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,13 @@ const HighlightInputForm = ({ refreshCallback }: HighlightInputFormProps): JSX.E
}`}
/>
)}
<p
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"
onClick={() => {
window.open(suggestion.url, "_blank");
}}
<a
href={suggestion.url}
target="_blank"
className="truncate max-w-[14rem] xs:max-w-[16rem] text-xs xs:text-sm"
>
{suggestion.title}
</p>
</a>
</div>
<Tooltip className="text-xs modal-tooltip" direction="top" content="Fill content">
<button
Expand Down Expand Up @@ -1023,14 +1022,14 @@ const HighlightInputForm = ({ refreshCallback }: HighlightInputFormProps): JSX.E
</form>
)}

<Fab className="md:hidden">
<div
onClick={() => setIsFormOpenMobile(true)}
className="p-3 mb-10 -mr-4 text-white rounded-full shadow-lg bg-light-orange-10"
<Fab className="md:hidden" onClick={() => setIsFormOpenMobile(true)}>
<span
className="outline-none p-3 mb-10 -mr-4 text-white rounded-full shadow-lg bg-light-orange-10"
id="mobile-highlight-create"
>
<span className="sr-only">Create a highlight</span>
<RxPencil1 className="text-3xl" />
</div>
</span>
</Fab>
</>
);
Expand Down
Loading