From b419db505b8cd5e7aa92043696f42a0d710d9226 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 8 Jun 2022 15:18:41 -0300
Subject: ui testing

---
 packages/anastasis-webui/src/stories.tsx | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

(limited to 'packages/anastasis-webui/src/stories.tsx')

diff --git a/packages/anastasis-webui/src/stories.tsx b/packages/anastasis-webui/src/stories.tsx
index a51dfb20f..351d6f37b 100644
--- a/packages/anastasis-webui/src/stories.tsx
+++ b/packages/anastasis-webui/src/stories.tsx
@@ -143,21 +143,24 @@ function ExampleList({
               {k.examples.map((r) => {
                 const e = encodeURIComponent;
                 const eId = `${e(r.group)}-${e(r.component)}-${e(r.name)}`;
+                function doSelection(e: any): void {
+                  e.preventDefault();
+                  location.hash = `#${eId}`;
+                  onSelectStory(r, eId);
+                }
                 const isSelected =
                   selected &&
                   selected.component === r.component &&
                   selected.group === r.group &&
                   selected.name === r.name;
                 return (
-                  <dd id={eId} key={r.name} data-selected={isSelected}>
-                    <a
-                      href={`#${eId}`}
-                      onClick={(e) => {
-                        e.preventDefault();
-                        location.hash = `#${eId}`;
-                        onSelectStory(r, eId);
-                      }}
-                    >
+                  <dd
+                    id={eId}
+                    key={r.name}
+                    data-selected={isSelected}
+                    onClick={doSelection}
+                  >
+                    <a href={`#${eId}`} onClick={doSelection}>
                       {r.name}
                     </a>
                   </dd>
-- 
cgit v1.2.3

