Commit 54ddaece by Torkel Ödegaard Committed by GitHub

Table: Fixing scrolling draging the vertical handle (#23311)

* Table: Fixing scrolling draging the vertical handle

* updated snapshots
parent 2e58a65e
......@@ -2,7 +2,6 @@ import React, { Component } from 'react';
import isNil from 'lodash/isNil';
import classNames from 'classnames';
import Scrollbars from 'react-custom-scrollbars';
import { cx, css } from 'emotion';
interface Props {
className?: string;
......@@ -72,17 +71,11 @@ export class CustomScrollbar extends Component<Props> {
}
renderTrack = (track: 'track-vertical' | 'track-horizontal', hideTrack: boolean | undefined, passedProps: any) => {
return (
<div
{...passedProps}
className={cx(
css`
visibility: ${hideTrack ? 'hidden' : 'visible'};
`,
track
)}
/>
);
if (passedProps.style && hideTrack) {
passedProps.style.display = 'none';
}
return <div {...passedProps} className={track} />;
};
renderThumb = (thumb: 'thumb-horizontal' | 'thumb-vertical', passedProps: any) => {
......
......@@ -37,7 +37,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
</p>
</div>
<div
className="css-52gpmd track-horizontal"
className="track-horizontal"
style={
Object {
"display": "none",
......@@ -58,7 +58,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
/>
</div>
<div
className="css-52gpmd track-vertical"
className="track-vertical"
style={
Object {
"display": "none",
......
......@@ -68,7 +68,7 @@ export const Table: FC<Props> = memo(({ data, height, onCellClick, width, column
return (
<div {...getTableProps()} className={tableStyles.table}>
<CustomScrollbar>
<CustomScrollbar hideVerticalTrack={true}>
{!noHeader && (
<div>
{headerGroups.map((headerGroup: HeaderGroup) => (
......
......@@ -220,7 +220,7 @@ exports[`ServerStats Should render table with stats 1`] = `
</div>
</div>
<div
className="css-52gpmd track-horizontal"
className="track-horizontal"
style={
Object {
"display": "none",
......@@ -241,7 +241,7 @@ exports[`ServerStats Should render table with stats 1`] = `
/>
</div>
<div
className="css-52gpmd track-vertical"
className="track-vertical"
style={
Object {
"display": "none",
......
......@@ -353,8 +353,8 @@ export class PanelInspector extends PureComponent<Props, State> {
return (
<Drawer title={this.drawerHeader} width={drawerWidth} onClose={this.onDismiss}>
<TabContent className={styles.tabContent}>
{tab === InspectTab.Data && this.renderDataTab()}
<CustomScrollbar autoHeightMin="100%">
{tab === InspectTab.Data && this.renderDataTab()}
{tab === InspectTab.Meta && this.renderMetadataInspector()}
{tab === InspectTab.Request && this.renderRequestTab()}
{tab === InspectTab.Error && this.renderErrorTab(error)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment