From 796c0f367953c6f3b0c516e6efcc7439ca62edf8 Mon Sep 17 00:00:00 2001 From: ada mandala Date: Thu, 28 Sep 2023 15:18:55 -0500 Subject: [PATCH] fix some viewer bugs --- .../src/js/plugin/activate.js | 23 +++++++++++-------- .../src/less/containers/split-panel.less | 5 ++-- rust/perspective-viewer/src/less/viewer.less | 7 ++++++ 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/packages/perspective-viewer-datagrid/src/js/plugin/activate.js b/packages/perspective-viewer-datagrid/src/js/plugin/activate.js index dbb5faf8ea..86fd47292b 100644 --- a/packages/perspective-viewer-datagrid/src/js/plugin/activate.js +++ b/packages/perspective-viewer-datagrid/src/js/plugin/activate.js @@ -160,17 +160,20 @@ export async function activate(view) { viewer.addEventListener( "perspective-toggle-column-settings", (event) => { - style_selected_column( - this.regular_table, - event.detail.column_name - ); - if (!event.detail.open) { - this.model._column_settings_selected_column = null; - return; + // NOTE: This is a hack. We'll need to implement a `deactivate` function on the API to properly remove this eventlistener. + if (this.isConnected) { + style_selected_column( + this.regular_table, + event.detail.column_name + ); + if (!event.detail.open) { + this.model._column_settings_selected_column = null; + return; + } + + this.model._column_settings_selected_column = + event.detail.column_name; } - - this.model._column_settings_selected_column = - event.detail.column_name; } ); diff --git a/rust/perspective-viewer/src/less/containers/split-panel.less b/rust/perspective-viewer/src/less/containers/split-panel.less index 3e220cacc5..888734fc19 100644 --- a/rust/perspective-viewer/src/less/containers/split-panel.less +++ b/rust/perspective-viewer/src/less/containers/split-panel.less @@ -11,7 +11,8 @@ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ :host { - .split-panel.orient-reverse > .split-panel-child:not(:last-child):not(.is-width-override) { + .split-panel.orient-reverse + > .split-panel-child:not(:last-child):not(.is-width-override) { max-width: 300px; } @@ -52,7 +53,7 @@ .split-panel-divider { flex: 0 0 6px; transition: background-color 0.2s ease-out; - z-index: 2; + z-index: var(--settings-panel-z-index); &:hover { background-color: rgba(0, 0, 0, 0.05); diff --git a/rust/perspective-viewer/src/less/viewer.less b/rust/perspective-viewer/src/less/viewer.less index 2913c2dec8..f5808d1338 100644 --- a/rust/perspective-viewer/src/less/viewer.less +++ b/rust/perspective-viewer/src/less/viewer.less @@ -10,6 +10,10 @@ // ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ +:host { + --settings-panel-z-index: 10; +} + :host .sidebar_close_button { position: absolute; top: 0; @@ -132,6 +136,7 @@ padding-left: 8px; box-sizing: border-box; width: 100%; + z-index: var(--settings-panel-z-index); & > .split-panel-child { overflow: hidden; @@ -301,6 +306,8 @@ width: 100%; background-color: var(--inactive--color, #6e6e6e); margin-top: 1px; + flex-shrink: 0; + flex-grow: 0; } .expr_editor_column,