Skip to content

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

Open
viktorkombov wants to merge 3 commits into
22.2.xfrom
vkombov/fix-17578-22.2.x
Open

viktorkombov wants to merge 3 commits into
22.2.xfrom
vkombov/fix-17578-22.2.x

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.
@viktorkombov
viktorkombov requested a review from mddragnev October 8, 2026 13:05
Copilot AI balanced review requested due to automatic review settings October 8, 2026 13:05

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 tests query dialog content from its former host after it has moved into the overlay, causing null dereferences.

1 open finding
What changed in this PR

Fixes programmatic dialog opening from nested OnPush components and asynchronous callbacks.

Changes:

  • Marks the dialog view for checking in open().
  • Adds zoneless and ZoneJS regression tests.
  • Updates documentation and changelog.
File Description
dialog.component.ts Moves change-detection notification into open().
dialog.component.spec.ts Adds nested OnPush regression tests.
dialog/​README.md Documents programmatic opening behavior.
CHANGELOG.md Records the dialog bug fix.

🧠 Review effort: Balanced


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

fixture.nativeElement.querySelector(buttonSelector).click();
await fixture.whenStable();

const dialogWindow = host.querySelector<HTMLElement>('.igx-dialog__window');
viktorkombov and others added 2 commits October 9, 2026 17:10
…2.2.x

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants