Skip to content

Commit

Permalink
Merge pull request #631 from sebgroup/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
wallybeetles authored Sep 28, 2022
2 parents 6d7e3d9 + cdce206 commit 15971b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class CustomTestClass {
constructor() {
const today: Date = new Date();
this.dateValue = today;
this.startDate = new Date(today.getFullYear(), 0, today.getDate());
this.endDate = new Date(today.getFullYear(), 11, today.getDate());
this.startDate = new Date(today.getFullYear(), -1, today.getDate());
this.endDate = new Date(today.getFullYear(), 12, today.getDate());

this.id = "my-datepicker";
this.className = "my-class";
Expand Down
3 changes: 3 additions & 0 deletions projects/ng-components/lib/dropdown/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ export class DropdownComponent implements ControlValueAccessor, OnChanges, OnDes
this.nativeOnChange && this.nativeOnChange(event);
this.selectedValue = items;
}

this.onChangeCallback && this.onChangeCallback(this.selectedValue);
this.onTouchedCallback && this.onTouchedCallback();
}

/** Function which handles the logic of setting the non-native onChange prop (and sets the internal selected value as well) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ export class ToggleSelectorComponent implements ControlValueAccessor, OnInit {
this.list &&
this.list.map(e => {
if (this.multi) {
let selected: boolean = !!(this.value as Array<IToggleSelector>)?.find((element: any) => element.value === e.value);
let selected: boolean = false;

if (Array.isArray(this.value) && this.value.length > 0) {
selected = !!this.value.find((element: IToggleSelector) => element.value === e.value);
}

return { optionItem: e, selected } as IDisplayToggleSelector;
} else {
let selected: boolean = (this.value as IToggleSelector)?.value === e.value;
Expand Down

0 comments on commit 15971b3

Please sign in to comment.