@fenderdigital/react-accordion
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -39,7 +39,10 @@ 'use strict'; | ||
var onCallback = this.props.onCallback; | ||
var _props = this.props, | ||
disableTriangle = _props.disableTriangle, | ||
isVisible = _props.isVisible, | ||
onCallback = _props.onCallback; | ||
this.setState(function (prevState) { | ||
return { | ||
isVisible: !prevState.isVisible | ||
isVisible: !disableTriangle ? !prevState.isVisible : isVisible | ||
}; | ||
@@ -52,8 +55,8 @@ }, function () { | ||
Accordion.prototype.renderButton = function renderButton() { | ||
var _props = this.props, | ||
disableTriangle = _props.disableTriangle, | ||
icon = _props.icon, | ||
label = _props.label, | ||
styles = _props.styles, | ||
transition = _props.transition; | ||
var _props2 = this.props, | ||
disableTriangle = _props2.disableTriangle, | ||
icon = _props2.icon, | ||
label = _props2.label, | ||
styles = _props2.styles, | ||
transition = _props2.transition; | ||
var isVisible = this.state.isVisible; | ||
@@ -84,5 +87,5 @@ | ||
Accordion.prototype.renderContent = function renderContent() { | ||
var _props2 = this.props, | ||
children = _props2.children, | ||
hasAnimation = _props2.hasAnimation; | ||
var _props3 = this.props, | ||
children = _props3.children, | ||
hasAnimation = _props3.hasAnimation; | ||
var isVisible = this.state.isVisible; | ||
@@ -89,0 +92,0 @@ |
@@ -30,3 +30,3 @@ { | ||
}, | ||
"version": "1.5.0" | ||
"version": "1.5.1" | ||
} |
@@ -12,6 +12,6 @@ import React, { Component } from 'react'; | ||
handleClick() { | ||
const { onCallback } = this.props; | ||
const { disableTriangle, isVisible, onCallback } = this.props; | ||
this.setState( | ||
prevState => ({ | ||
isVisible: !prevState.isVisible, | ||
isVisible: !disableTriangle ? !prevState.isVisible : isVisible, | ||
}), | ||
@@ -21,2 +21,3 @@ () => onCallback(this.state), | ||
} | ||
renderButton() { | ||
@@ -23,0 +24,0 @@ const { disableTriangle, icon, label, styles, transition } = this.props; |
164345
265