Skip to content

Commit a466f51

Browse files
committed
ENG-1990: Exclude all interactive elements from sidebar block navigation
Review follow-up: page refs, tags, block refs, links, inputs and buttons inside the rendered block navigate or act on their own, so the outer click handler double-fired. Navigation now only triggers for clicks on inert content.
1 parent ae5d410 commit a466f51

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/roam/src/components/LeftSidebarView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ const toggleFoldedState = async ({
179179
}
180180
};
181181

182+
const RENDERED_BLOCK_INTERACTIVE_SELECTOR =
183+
"a, button, input, [data-link-title], [data-tag], .rm-block-ref";
184+
182185
const RoamRenderedBlock = ({
183186
uid,
184187
onNavigate,
@@ -200,7 +203,7 @@ const RoamRenderedBlock = ({
200203

201204
const handleClick = (e: React.MouseEvent) => {
202205
const target = e.target as HTMLElement;
203-
if (target.closest("[data-roamjs-smartblock-button]")) return;
206+
if (target.closest(RENDERED_BLOCK_INTERACTIVE_SELECTOR)) return;
204207
onNavigate(e);
205208
};
206209

0 commit comments

Comments
 (0)