mat-select-trigger is invisible if value is undefined or null
See original GitHub issueBug, feature request, or proposal:
md-select-trigger
is invisible if value is undefined
or null
when MD_PLACEHOLDER_GLOBAL_OPTIONS
set to { float: 'always' }
(use to show field name)
i cant show ‘All’ or 'Please Select … ’ on the md-select
What is the expected behavior?
need a way to show hint text / empty option alternative text
What is the current behavior?
mat-select-trigger
is invisible if value is undefined
or null
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-vyqfqf
What is the use-case or motivation for changing an existing behavior?
use select as a list filter, or form control with a hint text
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:17 (6 by maintainers)
Top Results From Across the Web
mat-select not showing initially selected item - Stack Overflow
I'm using <mat-select-trigger> in order to display selected items - in ... I've also tried to used [(ngModel)] instead of [(value)] but none...
Read more >Select | Angular Material
MatSelectTrigger. Allows the user to customize the trigger that is displayed when the select has a value. Selector: mat- ...
Read more >How do you deal with null vs undefined? - DEV Community
On the other hand, null is used when you explicitly say that variable points to no value. You know that variable exists, but...
Read more >UNPKG - @angular/material
n */\n set: function (value) {\n // If the specified tabIndex value is null or undefined, fall back to the default value.\n this._tabIndex...
Read more >@angular/material-moment-adapter | Yarn - Package Manager
bug fix, input: only set as aria-invalid if the input isn't empty (#21609 (008bf7a246b20f9709c0f82dfb51c3e58a695b07), closes #18140. bug fix, select: value ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
now we have mat-label for this
@crisbeto I think you can close this issue
@crisbeto, regarding when to show it: I would strongly argue that if the value for ‘trigger’ is not empty, it should always be displayed. The developer has full control over the value provided to the trigger, and with a simple ‘Placeholder will not display unless the triggerValue is empty’ in the docs, it’s clear enough what needs to be done.
If that is not an option, then it should be one, via a flag.
For a use case, I present a multi-select where ‘No Selection’ is allowed. I would like to display ‘All’, ‘Partial ({{count}})’ or ‘None’. I cannot display None, because the selection is empty thus the (empty) placeholder is displayed instead.