From 75abb415d437d337382dc57717277fae67f57580 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 13 Jun 2018 16:17:26 +0100 Subject: [PATCH] improve tag panel accessibility and remove a no-op dispatch Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/TagPanel.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 0b6dc9fc75..77259c863d 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -84,7 +84,10 @@ const TagPanel = React.createClass({ }, onMouseDown(e) { - dis.dispatch({action: 'deselect_tags'}); + // only dispatch if its not a no-op + if (this.state.selectedTags.length > 0) { + dis.dispatch({action: 'deselect_tags'}); + } }, onCreateGroupClick(ev) { @@ -113,17 +116,18 @@ const TagPanel = React.createClass({ />; }); - const clearButton = this.state.selectedTags.length > 0 ? - : -
; + let clearButton; + if (this.state.selectedTags.length > 0) { + clearButton = + + ; + } return
- - { clearButton } - + { clearButton }