Skip to content

Commit

Permalink
[Uptime] Fix jerky monitor list expanded row behavior (#47080)
Browse files Browse the repository at this point in the history
* [Uptime] Fix jerky monitor list expanded row behavior

Only set loading to true when there are no items present to prevent the bug outlined in
in elastic/eui#2393 . Once that is fixed we can simply set the value here to
loading={loading}

Fixes #46244

* Also fix loading state of charts to not move the table around
  • Loading branch information
andrewvc authored Oct 2, 2019
1 parent 2b06c02 commit eab5553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const ChartWrapper: FC<Props> = ({
<EuiFlexGroup
justifyContent="spaceAround"
alignItems="center"
style={{ height, marginTop: `-${height}` }}
style={{ height, marginTop: `-${height}`, marginBottom: 0 }}
>
<EuiFlexItem grow={false}>
<EuiLoadingChart size="xl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export const MonitorListComponent = (props: Props) => {
values: { length: items.length },
})}
error={errors ? formatUptimeGraphQLErrorList(errors) : errors}
loading={loading}
// Only set loading to true when there are no items present to prevent the bug outlined in
// in https://github.com/elastic/eui/issues/2393 . Once that is fixed we can simply set the value here to
// loading={loading}
loading={loading && (!items || items.length < 1)}
isExpandable={true}
hasActions={true}
itemId="monitor_id"
Expand Down

0 comments on commit eab5553

Please sign in to comment.