Skip to content

Commit

Permalink
[Upd] Make toggleCollapse public question
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Dec 8, 2021
1 parent 3389a55 commit 22783b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Question.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class Question extends React.Component {
this.props.onChange(this.props.index, newState);
}

_toggleCollapse = () => {
toggleCollapse = () => {
if (this.props.collapsible) {

const question = this.props.question;
Expand Down Expand Up @@ -162,7 +162,7 @@ export default class Question extends React.Component {
<Card className="mb-3">
<Accordion.Toggle
as={Card.Header}
onClick={this._toggleCollapse}
onClick={this.toggleCollapse}
className={headerClassName + " question-header"}
onMouseEnter={this._onMouseEnterHandler}
onMouseLeave={this._onMouseLeaveHandler}
Expand Down Expand Up @@ -213,7 +213,7 @@ export default class Question extends React.Component {
return (
<Accordion activeKey={this.state.expanded ? question['@id'] : undefined} className="answerable-section">
<Card className="mb-3">
<Card.Header onClick={this._toggleCollapse} className={classNames(headerClassNames)}>
<Card.Header onClick={this.toggleCollapse} className={classNames(headerClassNames)}>
{this.renderAnswers()}
</Card.Header>
{collapsible ? <Accordion.Collapse eventKey={question['@id']}>{cardBody}</Accordion.Collapse> : { cardBody }}
Expand Down

0 comments on commit 22783b5

Please sign in to comment.