Skip to content

Commit bf0fa55

Browse files
committed
Update dropdown skeleton
1 parent dfebf12 commit bf0fa55

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/dropdown/dropdown.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
213213
* The `type` property specifies whether the `Dropdown` allows single selection or multi selection.
214214
*/
215215
ngOnInit() {
216-
if (!this.skeleton) {
216+
if (this.view) {
217217
this.view.type = this.type;
218218
}
219219
}
@@ -222,7 +222,7 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
222222
* Initializes classes and subscribes to events for single or multi selection.
223223
*/
224224
ngAfterContentInit() {
225-
if (!this.skeleton) {
225+
if (this.view) {
226226
this.view.type = this.type;
227227
this.view.size = this.size;
228228
this.view.select.subscribe(event => {
@@ -342,7 +342,7 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
342342
* Returns the display value if there is no selection, otherwise the selection will be returned.
343343
*/
344344
getDisplayValue(): Observable<string> {
345-
if (!this.skeleton) {
345+
if (this.view) {
346346
let selected = this.view.getSelected();
347347
if (selected && !this.displayValue) {
348348
if (this.type === "multi") {

src/dropdown/dropdown.stories.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,21 @@ storiesOf("Dropdown", module)
9191
.add("Skeleton", () => ({
9292
template: `
9393
<div style="width: 300px">
94-
<ibm-dropdown skeleton="true"></ibm-dropdown>
94+
<ibm-dropdown skeleton="true">
95+
<ibm-dropdown-list [items]="items"></ibm-dropdown-list>
96+
</ibm-dropdown>
9597
&nbsp;
96-
<ibm-dropdown skeleton="true" inline="true"></ibm-dropdown>
98+
<ibm-dropdown skeleton="true" inline="true">
99+
<ibm-dropdown-list [items]="items"></ibm-dropdown-list>
100+
</ibm-dropdown>
97101
</div>
98-
`
102+
`,
103+
props: {
104+
items: [
105+
{ content: "one" },
106+
{ content: "two" },
107+
{ content: "three" },
108+
{ content: "four" }
109+
]
110+
}
99111
}));

0 commit comments

Comments
 (0)