Skip to content

Commit 16d39af

Browse files
committed
merge
2 parents ab82a30 + 24b24bc commit 16d39af

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/combobox/combobox.component.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ import { NG_VALUE_ACCESSOR } from "@angular/forms";
3737
tabindex="0"
3838
type="button"
3939
aria-label="close menu"
40-
aria-haspopup="true">
40+
aria-haspopup="true"
41+
(click)="toggleDropdown()">
4142
<div
4243
*ngIf="type === 'multi' && pills.length > 0"
4344
(click)="clearSelected()"
@@ -60,7 +61,6 @@ import { NG_VALUE_ACCESSOR } from "@angular/forms";
6061
</div>
6162
<input
6263
[disabled]="disabled"
63-
(click)="toggleDropdown()"
6464
(keyup)="onSearch($event.target.value)"
6565
[value]="selectedValue"
6666
class="bx--text-input"
@@ -248,7 +248,7 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
248248
this.selectedValue = "";
249249
this.propagateChangeCallback(null);
250250
}
251-
// not gaurding these since the nativeElement has to be loaded
251+
// not guarding these since the nativeElement has to be loaded
252252
// for select to even fire
253253
this.elementRef.nativeElement.querySelector("input").focus();
254254
this.closeDropdown();
@@ -286,12 +286,15 @@ export class ComboBox implements OnChanges, OnInit, AfterViewInit, AfterContentI
286286
hostkeys(ev: KeyboardEvent) {
287287
if (ev.key === "Escape") {
288288
this.closeDropdown();
289-
} else if (ev.key === "ArrowDown" && !this.dropdownMenu.nativeElement.contains(ev.target)) {
289+
} else if ((ev.key === "ArrowDown" || ev.key === "Down") // `"Down"` is IE specific value
290+
&& (!this.dropdownMenu || !this.dropdownMenu.nativeElement.contains(ev.target))) {
290291
ev.stopPropagation();
291292
this.openDropdown();
292293
setTimeout(() => this.view.getCurrentElement().focus(), 0);
293-
} else if (ev.key === "ArrowUp" && this.dropdownMenu.nativeElement.contains(ev.target) && !this.view.hasPrevElement()) {
294-
this.elementRef.nativeElement.querySelector(".combobox_input").focus();
294+
} else if ((ev.key === "ArrowUp" || ev.key === "Up") // `"Up"` is IE specific value
295+
&& this.dropdownMenu.nativeElement.contains(ev.target)
296+
&& !this.view.hasPrevElement()) {
297+
this.elementRef.nativeElement.querySelector(".bx--text-input").focus();
295298
}
296299
}
297300

src/tiles/clickable-tile.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
(click)="onClick($event)"
3131
(keydown)="onKeyDown($event)"
3232
[href]="href"
33+
[target]="target"
3334
[attr.aria-disabled]="disabled">
3435
<ng-content></ng-content>
3536
</a>`
@@ -42,6 +43,13 @@ export class ClickableTile {
4243
*/
4344
@Input() href: string;
4445

46+
/**
47+
* Sets the `target` attribute on the `ibm-clickable-tile` element.
48+
* @type {string}
49+
* @memberof ClickableTile
50+
*/
51+
@Input() target: string;
52+
4553
/**
4654
* Set to `true` to disable the clickable tile.
4755
* @type {boolean}

src/tiles/tiles.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ storiesOf("Tiles", module)
3636
}))
3737
.add("Clickable", () => ({
3838
template: `
39-
<ibm-clickable-tile href="#">
40-
clickable tile content goes here...
39+
<ibm-clickable-tile href="https://www.carbondesignsystem.com/" target="_blank">
40+
Click the tile to open the Carbon Design System
4141
</ibm-clickable-tile>
4242
`
4343
}));

0 commit comments

Comments
 (0)