bug(MATSELECT): Now that overlayDir is protected (_overlayDir) what is the best practice way of accessing this?
See original GitHub issueReproduction
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:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
.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.