From b67bb44a0622198df5a4b8b2fe372eaeaf51bb97 Mon Sep 17 00:00:00 2001 From: Michal Dziekonski Date: Wed, 7 Oct 2015 21:06:00 +0200 Subject: [PATCH] Don't be so strict about falsiness comparison (match this with the rest of the code) --- src/Pagination.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Pagination.js b/src/Pagination.js index 97b316bb17..a09a8117d2 100644 --- a/src/Pagination.js +++ b/src/Pagination.js @@ -14,8 +14,7 @@ const Pagination = React.createClass({ maxButtons: React.PropTypes.number, /** * When `true`, will display the default node value ('...'). - * When exactly `false`, will not display the element at all. - * Every other value (`truthy` or `null`) will be passed "as is". + * Otherwise, will display provided node (when specified). */ ellipsis: React.PropTypes.oneOfType([ React.PropTypes.bool, @@ -23,8 +22,7 @@ const Pagination = React.createClass({ ]), /** * When `true`, will display the default node value ('«'). - * When exactly `false`, will not display the element at all. - * Every other value (`truthy` or `null`) will be passed "as is". + * Otherwise, will display provided node (when specified). */ first: React.PropTypes.oneOfType([ React.PropTypes.bool, @@ -32,8 +30,7 @@ const Pagination = React.createClass({ ]), /** * When `true`, will display the default node value ('»'). - * When exactly `false`, will not display the element at all. - * Every other value (`truthy` or `null`) will be passed "as is". + * Otherwise, will display provided node (when specified). */ last: React.PropTypes.oneOfType([ React.PropTypes.bool, @@ -41,8 +38,7 @@ const Pagination = React.createClass({ ]), /** * When `true`, will display the default node value ('‹'). - * When exactly `false`, will not display the element at all. - * Every other value (`truthy` or `null`) will be passed "as is". + * Otherwise, will display provided node (when specified). */ prev: React.PropTypes.oneOfType([ React.PropTypes.bool, @@ -50,8 +46,7 @@ const Pagination = React.createClass({ ]), /** * When `true`, will display the default node value ('›'). - * When exactly `false`, will not display the element at all. - * Every other value (`truthy` or `null`) will be passed "as is". + * Otherwise, will display provided node (when specified). */ next: React.PropTypes.oneOfType([ React.PropTypes.bool, @@ -123,7 +118,7 @@ const Pagination = React.createClass({ ); } - if (maxButtons && hasHiddenPagesAfter && ellipsis !== false) { + if (maxButtons && hasHiddenPagesAfter && ellipsis) { pageButtons.push(