mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
LogsPanel: Fix scrollbar (#24850)
* Fix scrolling, besides context (wip) * Remove autoHide * Revert "Remove autoHide" This reverts commit3572718cab
. * Revert "Fix scrolling, besides context (wip)" This reverts commit8e11d89612
. * Fix scrolling in Logs Panel * Rename passed prop to disableCustomHorizontalScroll
This commit is contained in:
parent
de46dc7af0
commit
4f6fb2d46e
@ -26,6 +26,9 @@ export interface Props extends Themeable {
|
||||
rowLimit?: number;
|
||||
allowDetails?: boolean;
|
||||
previewLimit?: number;
|
||||
// Passed to fix problems with inactive scrolling in Logs Panel
|
||||
// Can be removed when we unify scrolling for Panel and Explore
|
||||
disableCustomHorizontalScroll?: boolean;
|
||||
onClickFilterLabel?: (key: string, value: string) => void;
|
||||
onClickFilterOutLabel?: (key: string, value: string) => void;
|
||||
getRowContext?: (row: LogRowModel, options?: RowContextOptions) => Promise<any>;
|
||||
@ -89,6 +92,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
||||
allowDetails,
|
||||
previewLimit,
|
||||
getFieldLinks,
|
||||
disableCustomHorizontalScroll,
|
||||
} = this.props;
|
||||
const { renderAll } = this.state;
|
||||
const { logsRowsTable, logsRowsHorizontalScroll } = getLogRowStyles(theme);
|
||||
@ -98,7 +102,10 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
||||
? dedupedRows.reduce((sum, row) => (row.duplicates ? sum + row.duplicates : sum), 0)
|
||||
: 0;
|
||||
const showDuplicates = dedupStrategy !== LogsDedupStrategy.none && dedupCount > 0;
|
||||
const horizontalScrollWindow = wrapLogMessage ? '' : logsRowsHorizontalScroll;
|
||||
|
||||
// For horizontal scrolling we can't use CustomScrollbar as it causes the problem with logs context - it is not visible
|
||||
// for top log rows. Therefore we use CustomScrollbar only in LogsPanel and for Explore, we use custom css styling.
|
||||
const horizontalScrollWindow = wrapLogMessage && !disableCustomHorizontalScroll ? '' : logsRowsHorizontalScroll;
|
||||
|
||||
// Staged rendering
|
||||
const processedRows = dedupedRows ? dedupedRows : [];
|
||||
|
@ -35,6 +35,7 @@ export const LogsPanel: React.FunctionComponent<LogsPanelProps> = ({
|
||||
wrapLogMessage={wrapLogMessage}
|
||||
timeZone={timeZone}
|
||||
allowDetails={true}
|
||||
disableCustomHorizontalScroll={true}
|
||||
/>
|
||||
</CustomScrollbar>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user