
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
mat-select-filter
Advanced tools
https://github.com/mdlivingston/mat-select-filter
The mat-select-filter is a filterer for the material select drop downs. They currently do not support this so I decided to make my own.
https://stackblitz.com/edit/mat-select-filter
$ npm install mat-select-filter
Be sure to import into desired module:
import { MatSelectFilterModule } from 'mat-select-filter';
Next just add it to the desired material select:
<mat-form-field>
<mat-select>
<mat-select-filter [array]="variables" (filteredReturn)="filteredVariables = $event"></mat-select-filter>
<mat-option *ngFor="let variable of filteredVariables">
{{variable}}
</mat-option>
</mat-select>
</mat-form-field>
Send your desired filtered array using the [array]="variables" or [array]="['one', 'two', 'three']". It now accepts an array objects thanks to Sen Alexandru. To use an array of objects just specify the objects key value you want to filter using the [displayMember] input. For example:
var variables = [
{
id: 0,
name: 'test1'
},
{
id: 0,
name: 'test1'
}
]
<mat-form-field>
<mat-select>
<mat-select-filter [array]="variables" [displayMember]="'name'" (filteredReturn)="filteredVariables = $event"></mat-select-filter>
<mat-option *ngFor="let variable of filteredVariables">
{{variable}}
</mat-option>
</mat-select>
</mat-form-field>
mat-select-filter now supports option group support thanks to jenniferarce! Just input the [hasGroup] boolean to true and add you [groupArrayName] string!
The (filteredReturn) method returns the filtered results after every keyboard action while searching...
The [noResultsMessage] is the string you would like to display when you filter no results.
The [showSpinner] allows you to turn off whether or not you would like to show a loading spinner while filtering.
The placeholder text for the search box is access by:
<mat-select-filter [placeholder]="'Search..'" [array]="variables" (filteredReturn)="filteredVariables = $event"></mat-select-filter>
but it defaults to 'Search...'
To focus the search input on every click you can do something like this:
<mat-form-field>
<mat-select #select [value]="selectedVariableName" placeholder="{{ placeholder }}">
<mat-select-filter *ngIf="select.focused" [array]="variables" (filteredReturn)="filteredVariables = $event"></mat-select-filter>
<mat-option *ngFor="let variable of filteredVariables">
{{variable}}
</mat-option>
</mat-select>
</mat-form-field>
otherwise it will only focus once.
To add a colored background do something like this:
<mat-select-filter [color]="'purple'" [array]="variables" (filteredReturn)="filteredVariables = $event"></mat-select-filter>
You can also change the classes from a global css/scss file in your project by adding:
.mat-filter{
background-color: purple !important;
}
.mat-filter-input {
border: 1px solid black !important
}
Hope you enjoy!
FAQs
https://github.com/mdlivingston
The npm package mat-select-filter receives a total of 3,724 weekly downloads. As such, mat-select-filter popularity was classified as popular.
We found that mat-select-filter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.