Skip to content

Conversation

@wagnermaciel
Copy link
Contributor

No description provided.

@wagnermaciel wagnermaciel requested a review from ok7sai November 7, 2025 15:03
@wagnermaciel wagnermaciel requested a review from a team as a code owner November 7, 2025 15:03
@wagnermaciel wagnermaciel requested review from crisbeto and removed request for a team November 7, 2025 15:03
@wagnermaciel wagnermaciel added target: rc This PR is targeted for the next release-candidate dev-app preview When applied, previews of the dev-app are deployed to Firebase labels Nov 7, 2025
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Deployed dev-app for 0d57b47 to: https://ng-dev-previews-comp--pr-angular-components-32279-dev-48uujtwx.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

}

@Directive({
selector: 'dialog[ngComboboxDialog]',
Copy link
Member

Choose a reason for hiding this comment

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

Is the dialog meant to be positioned relative to a trigger element or will it always be centered on the page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The dialog can either be centered or have special positioning depending on the use case. The positioning of the dialog is left up to developers


afterRenderEffect(() => {
if (this.element) {
this.combobox._pattern.expanded()
Copy link
Member

Choose a reason for hiding this comment

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

I think that by default native dialogs can be closed by clicking outside. I think we might end up in a situation where the expanded state of the pattern isn't in sync with the dialog's expanded state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is handled by the ComboboxDialogPattern, but in an unintuitive way. I went back and added a comment to clarify. The ComboboxDialogPattern has an onClick listener that handles this case. If the user clicks outside of the dialog, the click event fires on the dialog element.


const popupControls = this.inputs.popupControls();

if (popupControls instanceof ComboboxDialogPattern) {
Copy link
Member

Choose a reason for hiding this comment

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

It's worth noting that cases like this will prevent the dialog pattern from being tree shaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack

return;
}

if (popupControls instanceof ComboboxDialogPattern) {
Copy link
Member

Choose a reason for hiding this comment

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

It seems like we need special casing like this in several places. Would it make sense to just have a different combobox component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. The more popup cases that get handled the more complex the internals of the combobox are getting because of all the special casing.

I am considering an alternative approach which would simplify the implementation. The tldr is there should be multiple ComboboxPattern definitions and the wrapper Combobox directive should instantiate the right one depending on what popup it has.

I believe this change can happen in-place without changes to the public api, which is why I still sent out this PR

@wagnermaciel wagnermaciel requested a review from crisbeto November 7, 2025 15:34
@wagnermaciel wagnermaciel requested a review from crisbeto November 7, 2025 17:07
@wagnermaciel wagnermaciel added the action: merge The PR is ready for merge by the caretaker label Nov 7, 2025
@wagnermaciel wagnermaciel removed the request for review from ok7sai November 7, 2025 18:51
@wagnermaciel wagnermaciel merged commit f287cd6 into angular:main Nov 7, 2025
23 of 25 checks passed
@wagnermaciel
Copy link
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

wagnermaciel added a commit that referenced this pull request Nov 7, 2025
* fix(aria/combobox): dialog popup support

* fixup! fix(aria/combobox): dialog popup support

* fixup! fix(aria/combobox): dialog popup support

* fixup! fix(aria/combobox): dialog popup support

* fixup! fix(aria/combobox): dialog popup support

* fixup! fix(aria/combobox): dialog popup support

* fixup! fix(aria/combobox): dialog popup support

(cherry picked from commit f287cd6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker dev-app preview When applied, previews of the dev-app are deployed to Firebase target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants