From 13ac8ebf928a39c33279aced1dd4197c90aee624 Mon Sep 17 00:00:00 2001 From: BenjaVR Date: Tue, 26 Feb 2019 19:40:26 +0100 Subject: [PATCH] An even better hackier workaround to prevent popovers on touch devices - This one plays with input events instead of using media queries --- src/components/planning/PlanningsPage.tsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/planning/PlanningsPage.tsx b/src/components/planning/PlanningsPage.tsx index a20aaab..afff7ce 100644 --- a/src/components/planning/PlanningsPage.tsx +++ b/src/components/planning/PlanningsPage.tsx @@ -34,6 +34,7 @@ interface IPlanningsPageState { isPlanningsDetailVisible: boolean; studentsForPlanningsDetail: Student[]; selectedDateForPlanningDetail: moment.Moment | undefined; + userIsTouching: boolean; } class PlanningsPage extends React.Component { @@ -66,6 +67,7 @@ class PlanningsPage extends React.Component { @@ -86,6 +88,9 @@ class PlanningsPage extends React.ComponentCapaciteiten} content={this.renderDepartmentPopoverContent(plannedStudentsToday)} mouseEnterDelay={0.5} + trigger={this.state.userIsTouching ? "contextMenu" : "hover"} > -
+
{departmentsRows}
@@ -302,6 +308,20 @@ class PlanningsPage extends React.Component { + this.setState({ userIsTouching: false }); + }, 100); + } + private handlePlanningsDetailClose(): void { this.setState({ isPlanningsDetailVisible: false,