Skip to content

Commit

Permalink
Add an option to add custom classes to the dropdown-menu. Closes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
amiram committed Mar 21, 2020
1 parent c74e1ba commit 9cebc73
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
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;
}

0 comments on commit 9cebc73

Please sign in to comment.