Skip to content

Conversation

@crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 31, 2025

Includes the following fixes and improvements to the CDK overlay:

fix(cdk/overlay): simplify public API of overlay directive

Currently the CdkConnectedOverlay directive has 23 inputs which can be quite verbose. These changes add a shorthand through the cdkConnectedOverlay attribute for the cases where these values aren't expected to change.

fix(cdk/overlay): simplify matching the overlay to the trigger width

The connected overlay directive allows users to control its width using the cdkConnectedOverlayMatchWidth input. This can be tricky when it needs to match another element like the trigger.

Since this is a common for cases like dropdowns, these changes add the cdkConnectedOverlayMatchWidth input to simplify it.

fix(cdk/overlay): hide native backdrop

Explicitly hides the native backdrop from the CDK popover so it doesn't get rendered out.

fix(cdk/overlay): make it easier to set default for overlay directive

Adds the CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG injection token to make it easier to configure the CdkConnectedOverlay directive.

Currently the `CdkConnectedOverlay` directive has 23 inputs which can be quite verbose. These changes add a shorthand through the `cdkConnectedOverlay` attribute for the cases where these values aren't expected to change.
The connected overlay directive allows users to control its width using the `cdkConnectedOverlayMatchWidth` input. This can be tricky when it needs to match another element like the trigger.

Since this is a common for cases like dropdowns, these changes add the `cdkConnectedOverlayMatchWidth` input to simplify it.
Explicitly hides the native backdrop from the CDK popover so it doesn't get rendered out.
@crisbeto crisbeto requested a review from a team as a code owner October 31, 2025 09:08
@crisbeto crisbeto added the target: rc This PR is targeted for the next release-candidate label Oct 31, 2025
@crisbeto crisbeto requested review from adolgachev and andrewseguin and removed request for a team October 31, 2025 09:08
@crisbeto crisbeto added the merge: preserve commits When the PR is merged, a rebase and merge should be performed label Oct 31, 2025
@andrewseguin
Copy link
Contributor

Can the config be made injectable as well, so it inputs can be put into a provider?

Adds the `CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG` injection token to make it easier to configure the `CdkConnectedOverlay` directive.
@crisbeto crisbeto removed the request for review from adolgachev October 31, 2025 15:21
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Oct 31, 2025
@crisbeto crisbeto merged commit 41719c3 into angular:main Oct 31, 2025
23 of 25 checks passed
@crisbeto
Copy link
Member Author

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

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 area: cdk/overlay merge: preserve commits When the PR is merged, a rebase and merge should be performed target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants