Skip to content

Commit

Permalink
Merge branch 'master' into tsvb-drilldown-cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 20, 2021
2 parents e2d3b8e + 4ff3cb4 commit af68653
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export function DiscoverGridFlyout({
services,
setExpandedDoc,
}: Props) {
// Get actual hit with updated highlighted searches
const actualHit = useMemo(() => hits?.find(({ _id }) => _id === hit?._id) || hit, [hit, hits]);
const pageCount = useMemo<number>(() => (hits ? hits.length : 0), [hits]);
const activePage = useMemo<number>(() => {
const id = getDocFingerprintId(hit);
Expand Down Expand Up @@ -188,7 +190,7 @@ export function DiscoverGridFlyout({
</EuiFlyoutHeader>
<EuiFlyoutBody>
<DocViewer
hit={hit}
hit={actualHit}
columns={columns}
indexPattern={indexPattern}
filter={(mapping, value, mode) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class DocViewerTab extends React.Component<Props, State> {
shouldComponentUpdate(nextProps: Props, nextState: State) {
return (
nextProps.renderProps.hit._id !== this.props.renderProps.hit._id ||
!isEqual(nextProps.renderProps.hit.highlight, this.props.renderProps.hit.highlight) ||
nextProps.id !== this.props.id ||
!isEqual(nextProps.renderProps.columns, this.props.renderProps.columns) ||
nextState.hasError
Expand Down

0 comments on commit af68653

Please sign in to comment.