Skip to content

Commit 00643ad

Browse files
authored
Merge branch 'master' into dialog
2 parents 1032c84 + 808902d commit 00643ad

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/dropdown/dropdown.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
229229
this.propagateChange(this.view.getSelected());
230230
} else {
231231
this.closeMenu();
232-
this.dropdownButton.nativeElement.focus();
233232
if (event.item && event.item.selected) {
234233
if (this.value) {
235234
this.propagateChange(event.item[this.value]);
@@ -487,10 +486,15 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
487486
* Collapsing the dropdown menu and removing unnecessary `EventListeners`.
488487
*/
489488
closeMenu() {
489+
// return early if the menu is already closed
490+
if (this.menuIsClosed) { return; }
490491
this.menuIsClosed = true;
491492
this.onClose.emit();
492493
this.close.emit();
493494

495+
// focus the trigger button when we close ...
496+
this.dropdownButton.nativeElement.focus();
497+
494498
// remove the conditional once this api is settled and part of abstract-dropdown-view.class
495499
if (this.view["disableScroll"]) {
496500
this.view["disableScroll"]();

src/search/search.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export class Search implements ControlValueAccessor {
239239
*/
240240
clearSearch(): void {
241241
this.value = "";
242-
this.propagateChange(this.value);
242+
this.emitChangeEvent();
243243
}
244244

245245
/**

0 commit comments

Comments
 (0)