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

chips(readonly): should not trigger excessive watchers and digests #11753

Open
@marvelsrp

Description

@marvelsrp

Test on AngularJS Material 1.1.18

Detailed Reproduction Steps:

  1. Create list with 100 items and 10 chips
this.items = Array.from(Array(100), (item, index) => ({
      name: `Item ${index}`,
      chips: Array.from(Array(10), (item, index) => `Chip ${index}`);
     })
 );

  1. Render them items
div(ng-repeat="item in controller.items")
    b {{item.name}}
    md-chips(ng-model="item.chips" readonly="true")

What is the expected behavior?

Render immediate

What is the current behavior?

Was added ~12000 watchers and make ~1000 digests (once per added chip). Page will be lags 3-6 sec.

Digests were called from here:

I think in readonly mode $timeout with call focusLastChipThenInput can not be run.

Codepen:

https://codepen.io/marvelsrp/pen/RzZXgW

Metadata

Metadata

Assignees

Labels

P2: requiredIssues that must be fixed.needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or communitytype: performanceThis issue is related to performance

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions