Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to add custom classes to the dropdown-menu. Closes #182 #184

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Any item can be `disabled` for prevent selection. For disable an item add the pr
| isFocused | boolean | false | Makes the component focused |
| keepSelectMenuOpened | boolean | false | Keeps the select menu opened |
| autocomplete | string | `'off'` | Sets an autocomplete value for the input field |
| dropDownMenuOtherClasses | string | `''` | Add css classes to the element with `dropdown-menu` class. For example `dropdown-menu-right` |
| showOptionNotFoundForEmptyItems | boolean | false | Shows the "Not Found" menu option in case of out of items at all |

| Output | Description |
Expand Down
1 change: 1 addition & 0 deletions src/app/lib/ngx-select/ngx-select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

<!-- options template -->
<ul #choiceMenu role="menu" *ngIf="isFocused" class="ngx-select__choices dropdown-menu"
[ngClass]="dropDownMenuOtherClasses"
[class.show]="showChoiceMenu()">
<li class="ngx-select__item-group" role="menuitem"
*ngFor="let opt of optionsFiltered; trackBy: trackByOption; let idxGroup=index">
Expand Down
1 change: 1 addition & 0 deletions src/app/lib/ngx-select/ngx-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class NgxSelectComponent implements INgxSelectOptions, ControlValueAccess
@Input() public isFocused = false;
@Input() public keepSelectMenuOpened = false;
@Input() public autocomplete = 'off';
@Input() public dropDownMenuOtherClasses = '';
public keyCodeToRemoveSelected = 'Delete';
public keyCodeToOptionsOpen = ['Enter', 'NumpadEnter'];
public keyCodeToOptionsClose = 'Escape';
Expand Down
1 change: 1 addition & 0 deletions src/app/lib/ngx-select/ngx-select.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export interface INgxSelectOptions {
keyCodeToNavigateLast?: string;
isFocused?: boolean;
autocomplete?: string;
dropDownMenuOtherClasses?: string;
}