Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

(impact: medium) Datagrid action menu on top gets re-rendered on polling of data #379

@ps37

Description

@ps37

Prerequisites

  • Are you running the latest version? OR Are you submitting a bug for a prior version?
  • Did you perform a basic issue search?

Description

When Datagrid selection is set to multi, the action menu on top gets re-rendered even when the data that came back with polling and the selected entities have not changed. This is probably happening because, for multi-row selection, a new selected items array is being generated for every polling update which is being given as input to ActionMenuComponent and this is resulting in re-rendering.

Impact

This should be fixed for 2 reasons:

  • This results in a flicker on the screen which is not a good UX
  • The polling happens every few seconds and re-rendering of actions every few seconds can have a performance impact

Steps to Reproduce

  • Added a Stackblitz link below that shows the bug
  • Open the Stackblitz
  • Select any of the datagrid rows
  • Notice how the screen is flickering every 2 seconds

Expected behavior:
When the datagrid actions, items and, the selected entities are not changed, the action menu should not be re-rendered

Actual behavior:
The action menu is re-rendered for a multi-selection data grid on every data poll even when the data and selected entities have not changed

Versions

  1. npm: '6.13.4',
  2. node: '12.16.1',
  3. macOS Big Sur 11.3.1
  4. Chrome Version 91.0.4472.114

Stackblitz

https://stackblitz.com/edit/angular-b7crgu?file=src/app/datagrid-link.example.component.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions