From 930aaaa7526da8121d1dfca306eb566c2b9ee092 Mon Sep 17 00:00:00 2001 From: efarooqui Date: Tue, 22 Sep 2020 17:12:09 -0700 Subject: [PATCH] Working onSelect with respect to caret toggle; onSelect doesnt fire off when caret is selected --- src/components/Card.jsx | 18 ++++++++---------- src/components/Layout.js | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/Card.jsx b/src/components/Card.jsx index 3e9df64..1a59040 100644 --- a/src/components/Card.jsx +++ b/src/components/Card.jsx @@ -27,6 +27,13 @@ class Card extends React.Component { return makeNiceDate(datetime) } + handleCardSelect (e) { + if (!e.target.className.includes('arrow-down')) { + const selectedEventFormat = this.props.idx > 0 ? [this.props.event] : this.props.event + this.props.onSelect(selectedEventFormat, this.props.idx) + } + } + renderSummary () { return ( { - console.info('getting clicked') - if (!this.state.isOpen) { - const selectedEventFormat = idx > 0 ? [this.props.event] : this.props.event - this.props.onSelect(selectedEventFormat, idx) - } else { - console.info('NOT OPEN') - } - }} + onClick={(e) => this.handleCardSelect(e)} > {this.renderMain()} {this.state.isOpen ? this.renderExtra() : null} diff --git a/src/components/Layout.js b/src/components/Layout.js index a90174f..e820f30 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -83,7 +83,6 @@ class Dashboard extends React.Component { } handleSelect (selected, axis) { - console.info(selected) const matchedEvents = [] const TIMELINE_AXIS = 0 if (axis === TIMELINE_AXIS) {