Skip to content

Commit 58b16b1

Browse files
committed
blur -> blurIntent and fix review comments
1 parent e310a9a commit 58b16b1

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/combobox/combobox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
264264
this.updateSelected();
265265
});
266266

267-
this.view.blur.pipe(filter(v => v === "top")).subscribe(() => {
267+
this.view.blurIntent.pipe(filter(v => v === "top")).subscribe(() => {
268268
this.elementRef.nativeElement.querySelector(".bx--text-input").focus();
269269
});
270270
}

src/dropdown/abstract-dropdown-view.class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class AbstractDropdownView {
2929
* It's recommended that the implementing view include a specific type union of possible blurs
3030
* ex. `@Output() blur = new EventEmitter<"top" | "bottom">();`
3131
*/
32-
@Output() blur: EventEmitter<any>;
32+
@Output() blurIntent: EventEmitter<any>;
3333
/**
3434
* Specifies whether or not the `DropdownList` supports selecting multiple items as opposed to single
3535
* item selection.

src/dropdown/list/dropdown-list.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
126126
* ex.
127127
* ArrowUp -> focus first item
128128
* ArrowUp -> emit event
129+
*
130+
* When this event fires focus should be placed on some element outside of the list - blurring the list as a result
129131
*/
130-
@Output() blur = new EventEmitter<"top" | "bottom">();
132+
@Output() blurIntent = new EventEmitter<"top" | "bottom">();
131133
/**
132134
* Maintains a reference to the view DOM element for the unordered list of items within the `DropdownList`.
133135
*/
@@ -407,13 +409,13 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
407409
if (this.hasNextElement()) {
408410
this.getNextElement().focus();
409411
} else {
410-
this.blur.emit("bottom");
412+
this.blurIntent.emit("bottom");
411413
}
412414
} else if (event.key === "ArrowUp" || event.key === "Up") {
413415
if (this.hasPrevElement()) {
414416
this.getPrevElement().focus();
415417
} else {
416-
this.blur.emit("top");
418+
this.blurIntent.emit("top");
417419
}
418420
}
419421
}

0 commit comments

Comments
 (0)