From b5874c1428d9445921db242b248798adbf7b4b9d Mon Sep 17 00:00:00 2001 From: kibigo! Date: Sat, 6 Jan 2018 15:34:01 -0800 Subject: Fixes to search dropdown --- .../flavours/glitch/features/drawer/search/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/javascript/flavours/glitch/features/drawer/search/index.js') diff --git a/app/javascript/flavours/glitch/features/drawer/search/index.js b/app/javascript/flavours/glitch/features/drawer/search/index.js index 2d739349c..8cbb0906c 100644 --- a/app/javascript/flavours/glitch/features/drawer/search/index.js +++ b/app/javascript/flavours/glitch/features/drawer/search/index.js @@ -45,10 +45,10 @@ const handlers = { const { onClear, submitted, - value: { length }, + value, } = this.props; e.preventDefault(); // Prevents focus change ?? - if (onClear && (submitted || length)) { + if (onClear && (submitted || value && value.length)) { onClear(); } }, @@ -100,7 +100,8 @@ export default class DrawerSearch extends React.PureComponent { value, } = this.props; const { expanded } = this.state; - const computedClass = classNames('drawer--search', { active: value.length || submitted }); + const active = value && value.length || submitted; + const computedClass = classNames('drawer--search', { active }); return (
@@ -126,11 +127,11 @@ export default class DrawerSearch extends React.PureComponent { tabIndex='0' > - +
-- cgit