From 6594795f39bd6d14a7105dc61642baa034995bad Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 29 Jul 2022 13:10:51 -0400 Subject: [PATCH] Reverted incomplete fix about bug where opening card scrolls to wrong place. Thanks to danceb, DimDz, mfilser, Emile840, derbolle, xplodwild and xet7 ! Fixes #4572 --- client/components/cards/cardDetails.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index a84c843c2..152780658 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -86,17 +86,29 @@ BlazeComponent.extendComponent({ scrollParentContainer() { const cardPanelWidth = 600; const parentComponent = this.parentComponent(); + +/* + // Incomplete fix about bug where opening card scrolls to wrong place + // https://github.com/wekan/wekan/issues/4572#issuecomment-1184149395 // TODO sometimes parentComponent is not available, maybe because it's not // yet created?! if (!parentComponent) return; const bodyBoardComponent = parentComponent.parentComponent(); +*/ + //On Mobile View Parent is Board, Not Board Body. I cant see how this funciton should work then. if (bodyBoardComponent === null) return; const $cardView = this.$(this.firstNode()); const $cardContainer = bodyBoardComponent.$('.js-swimlanes'); + +/* + // Incomplete fix about bug where opening card scrolls to wrong place + // https://github.com/wekan/wekan/issues/4572#issuecomment-1184149395 // TODO sometimes cardContainer is not available, maybe because it's not yet // created?! if (!$cardContainer) return; +*/ + const cardContainerScroll = $cardContainer.scrollLeft(); const cardContainerWidth = $cardContainer.width();