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.

[Mat-select] Support for dense list of mat-option's

See original GitHub issue

Bug, feature request, or proposal:

I would like for you to add an attribute like with mat-list, that makes the list items denser. So basically <mat-select dense></mat-select>. If I try to reduce the height of the rows via css it gets all kinds of messed up with scrolling.

What is the expected behavior?

For the scrolling to work as it does with non default list item heights in mat-select for the mat-option’s.

What is the current behavior?

If I press the letter I want to get down to, I end up in the wrong place if I change the height via css. You can see this in the image below. In this case I pressed the letter “U”. mat-select-issue

This issue also occurs when I have selected something further down the list, and then re-clicks the mat-select element. Then I end up in the wrong place in the list. This is not too surprising, as I suspect that these are related to the each other.

The number of items in this list is 429 items.

What are the steps to reproduce?

.mat-option {
    line-height: 24px !important;
    height: 24px !important;
}

What is the use-case or motivation for changing an existing behavior?

My customer “demands” me to make it have less “air” as he calls it. And I too personally, would love to have the option. As I kind of agree that it shows less information per pixel (if I can say that).

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

All versions from v5 and up to me and all the regular browsers (Edge, Firefox, Chrome, Safari). For OS’s I’ve tested in macOS and Windows. I expect this to be the issue on Linux, iOS and Android also.

My current package versions are:

Angular CLI: 6.0.3
Node: 9.9.0
OS: darwin x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@angular/cdk                      6.1.0
@angular/cli                      6.0.3
@angular/material                 6.1.0
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3

Is there anything else we should know?

I would be truly greatful if this were something that were to be implemented.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ikourfalncommented, Sep 16, 2018

+1

0reactions
angular-robot[bot]commented, Feb 22, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn’t collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular’s scope, we’d encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Mat-select] Support for dense list of mat-option's · Issue #11455
I would like for you to add an attribute like with mat-list, that makes the list items denser. So basically <mat-select dense></mat-select> ....
Read more >
How to load angular material select mat-option list below the ...
I am using the material select element mat-select in my application. I want to load the option list just below the select field, ......
Read more >
Select | Angular Material
<mat-select> is a form control for selecting a value from a set of options, similar to the native <select> element. You can read...
Read more >
Unable to get the list of elements to select a text from the auto ...
Currently, I'm unable to get the list of elements as I'm struggling to find a unique element. ID is dynamic. WebElement select =...
Read more >
MatBlazor - Material Design components for Blazor
MatSelect was rewrited and prepared for MatSelectItem and MatSelectValue , supported only Enhanced mode, Disabled for MatOption is temporary not working ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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