mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [Logs UI] Fix initial accuracy of logs minimap click * Fix aberrant request to loadEntriesAfter when using minimap
This commit is contained in:
parent
329f1c248d
commit
5cedccdc6a
2 changed files with 10 additions and 4 deletions
|
@ -80,7 +80,8 @@ export class LogMinimap extends React.Component<LogMinimapProps, LogMinimapState
|
|||
}
|
||||
|
||||
public handleClick = (event: MouseEvent) => {
|
||||
const { svgPosition } = this.state;
|
||||
if (!this.dragTargetArea) return;
|
||||
const svgPosition = this.dragTargetArea.getBoundingClientRect();
|
||||
const clickedYPosition = event.clientY - svgPosition.top;
|
||||
const clickedTime = Math.floor(this.getYScale().invert(clickedYPosition));
|
||||
this.setState({
|
||||
|
|
|
@ -155,7 +155,7 @@ export class VerticalScrollPanel<Child> extends React.PureComponent<
|
|||
} = this;
|
||||
|
||||
if (scrollRef.current === null || !target || childDimensions.size <= 0) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const targetDimensions = childDimensions.get(target);
|
||||
|
@ -166,15 +166,20 @@ export class VerticalScrollPanel<Child> extends React.PureComponent<
|
|||
// opposed to being in direct response to user input
|
||||
this.nextScrollEventFromCenterTarget = true;
|
||||
scrollRef.current.scrollTop = targetDimensions.top + targetOffset - scrollViewHeight / 2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
public handleUpdatedChildren = (target: Child | undefined, offset: number | undefined) => {
|
||||
this.updateChildDimensions();
|
||||
let centerTargetWillReportChildren = false;
|
||||
if (!!target) {
|
||||
this.centerTarget(target, offset);
|
||||
centerTargetWillReportChildren = this.centerTarget(target, offset);
|
||||
}
|
||||
if (!centerTargetWillReportChildren) {
|
||||
this.reportVisibleChildren();
|
||||
}
|
||||
this.reportVisibleChildren();
|
||||
};
|
||||
|
||||
public componentDidMount() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue