Skip to content

Commit e1bfb92

Browse files
authored
Merge branch 'master' into issue#450
2 parents 3f70096 + f3108a0 commit e1bfb92

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

.storybook/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ addDecorator(
2727
);
2828

2929
// load global styles
30-
require("!style-loader!css-loader!sass-loader!./preview.scss");
31-
require("!style-loader!css-loader!sass-loader!./preview-experimental.scss");
30+
require("!style-loader!css-loader!postcss-loader!sass-loader!./preview.scss");
31+
require("!style-loader!css-loader!postcss-loader!sass-loader!./preview-experimental.scss");
3232

3333
require("../src/index.stories");
3434
// automatically import all files ending in *.stories.ts

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
212212
this.index = this._items.findIndex(item => item.selected);
213213
this.setupFocusObservable();
214214
setTimeout(() => {
215+
if (!this.getSelected()) { return; }
215216
if (this.type === "single") {
216217
this.select.emit({ item: this._items.find(item => item.selected) });
217218
} else {

src/pagination/pagination.component.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ExperimentalService } from "./../experimental.module";
2323
*
2424
* ```typescript
2525
* selectPage(page) {
26-
* // ... your code to laod the page goes here
26+
* // ... your code to load the page goes here
2727
*
2828
* this.model.currentPage = page;
2929
*
@@ -279,7 +279,6 @@ export class Pagination {
279279
* `PaginationModel` with the information about pages you're controlling.
280280
*
281281
* @type {Model}
282-
* @memberof Pagination
283282
*/
284283
@Input() model: PaginationModel;
285284

@@ -327,32 +326,28 @@ export class Pagination {
327326
*
328327
* You should tie into this and update `model.currentPage` once the fresh
329328
* data is finally loaded.
330-
*
331-
* @memberof Pagination
332329
*/
333330
@Output() selectPage = new EventEmitter<number>();
334331

335332
get itemsPerPage() {
336333
return this.model.pageLength;
337334
}
338335
set itemsPerPage(value) {
339-
this.model.pageLength = value;
336+
this.model.pageLength = Number(value);
340337
this.currentPage = 1; // reset page
341338
}
342339

343340
get currentPage() {
344341
return this.model.currentPage;
345342
}
346343
set currentPage(value) {
344+
value = Number(value);
347345
// emits the value to allow the user to update current page
348346
// in the model once the page is loaded
349347
this.selectPage.emit(value);
350348
}
351349
/**
352350
* The last page number to display in the pagination view.
353-
*
354-
* @returns {number}
355-
* @memberof Pagination
356351
*/
357352
get lastPage(): number {
358353
const last = Math.ceil(this.model.totalDataLength / this.model.pageLength);
@@ -371,19 +366,13 @@ export class Pagination {
371366

372367
/**
373368
* The previous page number to navigate to, from the current page.
374-
*
375-
* @returns {number}
376-
* @memberof Pagination
377369
*/
378370
get previousPage(): number {
379371
return this.currentPage <= 1 ? 1 : this.currentPage - 1;
380372
}
381373

382374
/**
383375
* The next page number to navigate to, from the current page.
384-
*
385-
* @returns {number}
386-
* @memberof Pagination
387376
*/
388377
get nextPage(): number {
389378
const lastPage = this.lastPage;
@@ -412,12 +401,7 @@ export class Pagination {
412401
/**
413402
* Generates a list of numbers. (Python function)
414403
* Used to display the correct pagination controls.
415-
*
416-
* @param {number} stop
417-
* @param {number} [start=0]
418-
* @param {number} [step=1]
419404
* @returns {array}
420-
* @memberof Pagination
421405
*/
422406
range(stop: number, start = 0, step = 1) {
423407
return range(stop, start, step);

0 commit comments

Comments
 (0)