Skip to content

Commit 8075092

Browse files
committed
make buttons take focus so the blur events work
HTML is a cheeky rascal
1 parent e6e1df6 commit 8075092

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/routes/board.$id/components.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export let SaveButton = forwardRef<
99
return (
1010
<button
1111
ref={ref}
12+
// this makes it so the button takes focus on clicks in safari I can't
13+
// remember if this is the proper workaround or not, it's been a while!
14+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
15+
// https://bugs.webkit.org/show_bug.cgi?id=22261
16+
tabIndex={0}
1217
{...props}
1318
className="text-sm rounded-lg text-left p-2 font-medium text-white bg-brand-blue"
1419
/>
@@ -23,6 +28,7 @@ export let CancelButton = forwardRef<
2328
<button
2429
ref={ref}
2530
type="button"
31+
tabIndex={0}
2632
{...props}
2733
className="text-sm rounded-lg text-left p-2 font-medium hover:bg-slate-200 focus:bg-slate-200"
2834
/>

0 commit comments

Comments
 (0)