From d253933995aaa96546e597bf64236ef07bee7d5b Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:55:01 +0530 Subject: [PATCH] [WEB-2552] fix: issue list overflow and event propagation (#5706) --- .../modals/existing-issues-list-modal.tsx | 6 +-- .../issues/issue-layouts/list/block.tsx | 4 ++ .../issues/relations/issue-list-item.tsx | 14 +++-- .../issues/sub-issues/issue-list-item.tsx | 52 +++++++++++-------- 4 files changed, 47 insertions(+), 29 deletions(-) diff --git a/web/core/components/core/modals/existing-issues-list-modal.tsx b/web/core/components/core/modals/existing-issues-list-modal.tsx index 238efb7a9..659dd7bfb 100644 --- a/web/core/components/core/modals/existing-issues-list-modal.tsx +++ b/web/core/components/core/modals/existing-issues-list-modal.tsx @@ -249,7 +249,7 @@ export const ExistingIssuesListModal: React.FC = (props) => { } ${selected ? "text-custom-text-100" : ""}` } > -
+
= (props) => { textContainerClassName="text-xs text-custom-text-200" /> - {issue.name} + {issue.name}
e.stopPropagation()} > diff --git a/web/core/components/issues/issue-layouts/list/block.tsx b/web/core/components/issues/issue-layouts/list/block.tsx index 267dbd89b..59e7715c3 100644 --- a/web/core/components/issues/issue-layouts/list/block.tsx +++ b/web/core/components/issues/issue-layouts/list/block.tsx @@ -271,6 +271,10 @@ export const IssueBlock = observer((props: IssueBlockProps) => { "md:flex": isSidebarCollapsed, "lg:flex": !isSidebarCollapsed, })} + onClick={(e) => { + e.preventDefault(); + e.stopPropagation(); + }} > {quickActions({ issue, diff --git a/web/core/components/issues/relations/issue-list-item.tsx b/web/core/components/issues/relations/issue-list-item.tsx index acb8187dc..20bf1e2f0 100644 --- a/web/core/components/issues/relations/issue-list-item.tsx +++ b/web/core/components/issues/relations/issue-list-item.tsx @@ -95,12 +95,12 @@ export const RelationIssueListItem: FC = observer((props) => { id={`issue-${issue.id}`} href={`/${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`} onClick={() => handleIssuePeekOverview(issue)} - className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100" + className="w-full cursor-pointer" > {issue && (
-
+
= observer((props) => {
- {issue.name} + {issue.name}
-
+
{ + e.preventDefault(); + e.stopPropagation(); + }} + > = observer((props) => { id={`issue-${issue.id}`} href={`/${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`} onClick={() => handleIssuePeekOverview(issue)} - className="w-full line-clamp-1 cursor-pointer text-sm text-custom-text-100" + className="w-full cursor-pointer" > {issue && (
= observer((props) => { ) : (
{ + onClick={async (e) => { + e.preventDefault(); + e.stopPropagation(); if (!subIssueHelpers.issue_visibility.includes(issueId)) { setSubIssueHelpers(parentIssueId, "preview_loader", issueId); await subIssueOperations.fetchSubIssues(workspaceSlug, projectId, issueId); @@ -125,7 +127,7 @@ export const IssueListItem: React.FC = observer((props) => { )}
-
+
= observer((props) => { )}
- {issue.name} + {issue.name}
-
+
{ + e.preventDefault(); + e.stopPropagation(); + }} + > = observer((props) => {
)} - - {/* should not expand the current issue if it is also the root issue*/} - {subIssueHelpers.issue_visibility.includes(issueId) && - issue.project_id && - subIssueCount > 0 && - !isCurrentIssueRoot && ( - - )} + + {/* should not expand the current issue if it is also the root issue*/} + {subIssueHelpers.issue_visibility.includes(issueId) && + issue.project_id && + subIssueCount > 0 && + !isCurrentIssueRoot && ( + + )}
); });