Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(Mat*** all components): no support for zone-less application #23909

Closed
1 task
And2s opened this issue Nov 5, 2021 · 2 comments
Closed
1 task

bug(Mat*** all components): no support for zone-less application #23909

And2s opened this issue Nov 5, 2021 · 2 comments

Comments

@And2s
Copy link

And2s commented Nov 5, 2021

Is this a regression?

  • No

The previous version in which this bug was not present was

  • ...

Description

Cannot use without zone.js / or in components with ChangeDetectorRef detached.
Would be great if Angular Material Team would implement support for zone-less apps (or at least provide public changeDetectorRef param in each component so that developer could manually trigger component changes on need.)

I know it is on your roadmap. However, technically it is a bug, not a missing feature to not have support for native Angular options (ngZone: noop, cdRef.detach)

Reproduction

Steps to reproduce:

  1. cdRef.detach() in component constructor / or in main.ts set ngZone noop (e.g. .....bootstrapModule(AppModule, {ngZone: 'noop'}})
  2. use material component: mat-input, mat-autocomplete, mat-menu, .. etc.
  3. it wont work + on some events will throw console.error (e.g. Cannot read properties of undefined (reading 'nativeElement'))

Stackblitz https://stackblitz.com/edit/components-issue-6urqfj?file=src%2Fapp%2Fexample-component.ts

Expected Behavior

  • It should work in component with detached changes detector.
  • It should not depend (internally) on component change detection strategy at all.

Actual Behavior

  • Unusable material form components.
  • Sometimes manual trigger of change detection on blur / focus events seems to help.

Environment

  • Angular: v13.0.0
  • CDK/Material: 13.0.0
  • Browser(s): all browsers
  • Operating System: all OS
@And2s And2s added the needs triage This issue needs to be triaged by the team label Nov 5, 2021
@crisbeto
Copy link
Member

crisbeto commented Nov 6, 2021

Duplicate of #9169.

@crisbeto crisbeto closed this as completed Nov 6, 2021
@crisbeto crisbeto removed the needs triage This issue needs to be triaged by the team label Nov 6, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants