Skip to content

fix(dialog): mark view for check when open() is called programmatically - #17751

Open
viktorkombov wants to merge 3 commits into
masterfrom
vkombov/fix-17578
Open

viktorkombov wants to merge 3 commits into
masterfrom
vkombov/fix-17578

Conversation

@viktorkombov

Copy link
Copy Markdown
Contributor

The igx-dialog--hidden host class is refreshed by the parent view, so calling open() from an OnPush parent or an async callback left the dialog hidden. IgxToggleDirective.open() only runs detectChanges() on its own view, while the close path already calls markForCheck().

Add markForCheck() to IgxDialogComponent.open() and cover the parent call and async callback cases in both zoneless and ZoneJS mode.

Closes #17578

Description

Motivation / Context

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

The igx-dialog--hidden host class is refreshed by the parent view, so
calling open() from an OnPush parent or an async callback left the
dialog hidden. IgxToggleDirective.open() only runs detectChanges() on
its own view, while the close path already calls markForCheck().

Add markForCheck() to IgxDialogComponent.open() and cover the parent
call and async callback cases in both zoneless and ZoneJS mode.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new visibility assertions query content after it leaves the dialog host, causing null dereferences.

1 open finding
What changed in this PR

Fixes #17578 by refreshing dialog visibility when open() is called programmatically through an OnPush child or asynchronous callback.

Changes:

  • Moves markForCheck() into open().
  • Adds regression tests for zoneless and ZoneJS applications.
  • Documents the behavior and fix.
File Description
projects/​igniteui-angular/​dialog/​src/​dialog/​dialog.component.ts Marks the view for check when opening.
projects/​igniteui-angular/​dialog/​src/​dialog/​dialog.component.spec.ts Adds nested OnPush and asynchronous opening tests.
projects/​igniteui-angular/​dialog/​README.md Documents programmatic opening.
CHANGELOG.md Records the visibility fix.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread projects/igniteui-angular/dialog/src/dialog/dialog.component.spec.ts Outdated

@mddragnev mddragnev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more things:

  1. There is a conflict in the Changelog
  2. I don't think that this needs fixing in the 21.2.x branch. Have you confirmed that it is broken?

Comment thread projects/igniteui-angular/dialog/src/dialog/dialog.component.spec.ts Outdated
Comment thread projects/igniteui-angular/dialog/README.md Outdated
Comment thread projects/igniteui-angular/dialog/src/dialog/dialog.component.spec.ts Outdated
@viktorkombov

Copy link
Copy Markdown
Contributor Author

Two more things:

  1. There is a conflict in the Changelog
  2. I don't think that this needs fixing in the 21.2.x branch. Have you confirmed that it is broken?

It is broken in the 21.2.x branch,yes.

viktorkombov and others added 2 commits October 9, 2026 17:05
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Remove the JSDoc from the test components.
- Replace the looped describe blocks with explicit ones.
- Drop the README section on programmatic opening.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dialog ❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IgxDialog.open() does not open the dialog on Angular 22 with OnPush change detection

4 participants