From 6659c28293113f00b2f4227c759eb50839421102 Mon Sep 17 00:00:00 2001 From: danthe3rd Date: Thu, 4 Nov 2021 09:42:57 +0100 Subject: [PATCH] Hack-fix labels on safari when scrolling --- src/component.tsx | 7 +++++-- src/lib/browsercompat.ts | 29 +++++++++++++++++++++++++++++ src/lib/svghelpers.ts | 4 ++-- src/parallel/parallel.tsx | 15 +++++++++++++-- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 src/lib/browsercompat.ts diff --git a/src/component.tsx b/src/component.tsx index 2c05a7ee..0659b696 100644 --- a/src/component.tsx +++ b/src/component.tsx @@ -21,7 +21,7 @@ import { ErrorDisplay, HeaderBar } from "./header"; import { HiPlotPluginData, DataProviderClass } from "./plugin"; import { StaticDataProvider } from "./dataproviders/static"; import { uncompress } from "./lib/compress"; - +import { setupBrowserCompat } from "./lib/browsercompat"; //@ts-ignore import LogoSVG from "../hiplot/static/logo.svg"; @@ -152,6 +152,7 @@ export function createDefaultPlugins(): PluginsMap { export class HiPlot extends React.Component { // React refs contextMenuRef = React.createRef(); + rootRef = React.createRef(); plugins_window_state: {[plugin: string]: any} = {}; @@ -322,6 +323,8 @@ export class HiPlot extends React.Component { this.callFilteredUidsHooks.cancel(); } componentDidMount() { + setupBrowserCompat(this.rootRef.current); + // Setup contextmenu when we right-click a parameter this.contextMenuRef.current.addCallback(this.columnContextMenu.bind(this), this); @@ -532,7 +535,7 @@ export class HiPlot extends React.Component { }; }.bind(this); return ( -
+
{ [key: string]: V; }; @@ -152,10 +153,11 @@ export class ParallelPlot extends React.Component