question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(MATSELECT): Now that overlayDir is protected (_overlayDir) what is the best practice way of accessing this?

See original GitHub issue

Reproduction

select.d.ts used to have:

/**
     * Overlay pane containing the options.
     * @deprecated To be turned into a private API.
     * @breaking-change 10.0.0
     * @docs-private
     */
    overlayDir: CdkConnectedOverlay;

But now, it’s protected:

/** Overlay pane containing the options. */
    protected _overlayDir: CdkConnectedOverlay;

What is the best practices way of accessing this now that it is protected? I use overlayDir to modify the location of select dropdowns and I am not sure how to access this now that it is protected, or if I even should be accessing it in this manner any longer. Is there a new preferred way to modify the location of select dropdowns?

Expected Behavior

What behavior were you expecting to see?

  • overlayDir as an accessible option

Actual Behavior

What behavior did you actually see?

  • _overlayDir is now protected

Environment

  • Angular: 12.2.5
  • CDK/Material: 12.2.5
  • Browser(s): Chrome, Safari
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Sep 30, 2021

We’re moving away from positioning the dropdown on top of the select. You can try our new select based on top of MDC’s styles. The API and behavior is exactly the same since it shares the same base class as the current select, but the CSS will be slightly different and the dropdown is only positioned above/below. You can try it by importing MatSelectModule from @angular/material-experimental/mdc-select instead of @angular/material/select.

0reactions
angular-automatic-lock-bot[bot]commented, Jan 30, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MatSelect overlayDir now private when updating from Angular ...
Property '_overlayDir' is protected and only accessible within class '_MatSelectBase<C>' and its subclasses. I then imported _MatSelectBase but ...
Read more >
MatSelect overlayDir now private when ... - Google Groups
Property '_overlayDir' is protected and only accessible within class '_MatSelectBase<C>' and its subclasses. ``` I then imported _MatSelectBase ...
Read more >
angular/material2 - Gitter
This is in the Material Guidelines https://material.io/guidelines/motion/transforming-material.html# ... For MatSelect, the overlayDir is now private.
Read more >
Access Angular Material's MatSelect Options Panel Container
We only need a way to get access to the MatSelect instance from within our directive, s.t. we can grab the panel reference...
Read more >
angular/material - UNPKG
*/\n public source: MatSelect,\n /** Current value of the select that emitted the ... */\n @ViewChild(CdkConnectedOverlay, {static: false}) overlayDir: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found