From 51ad3c6b5d49744a4ef032049d2d923cde2218e1 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 9 Sep 2022 04:13:27 +0100 Subject: [PATCH] Fix nits --- beta/src/components/MDX/ExpandableExample.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/beta/src/components/MDX/ExpandableExample.tsx b/beta/src/components/MDX/ExpandableExample.tsx index bb061062..435f9142 100644 --- a/beta/src/components/MDX/ExpandableExample.tsx +++ b/beta/src/components/MDX/ExpandableExample.tsx @@ -30,11 +30,7 @@ function ExpandableExample({
{ - setIsExpanded(e.target!.open); - }} - onClick={(e) => { - // We toggle using a button instead of this whole area. - e.preventDefault(); + setIsExpanded(e.currentTarget!.open); }} className={cn('my-12 rounded-lg shadow-inner relative', { 'dark:bg-opacity-20 dark:bg-purple-60 bg-purple-5': isDeepDive, @@ -42,7 +38,11 @@ function ExpandableExample({ })}> + tabIndex={-1 /* there's a button instead */} + onClick={(e) => { + // We toggle using a button instead of this whole area. + e.preventDefault(); + }}>