Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Fix up variable not hiding when rendered in code block
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Aug 1, 2018
1 parent 0b1dbbb commit acf255f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/api-explorer/src/Variable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class Variable extends React.Component {
this.toggleVarDropdown = this.toggleVarDropdown.bind(this);
this.toggleAuthDropdown = this.toggleAuthDropdown.bind(this);
this.renderVarDropdown = this.renderVarDropdown.bind(this);
this.onChange = this.onChange.bind(this);
}
onChange(event) {
this.toggleVarDropdown();
this.props.changeSelected(event.target.value)
}
getDefault() {
const def = this.props.defaults.find(d => d.name === this.props.variable) || {};
Expand All @@ -62,10 +67,9 @@ class Variable extends React.Component {
}
renderVarDropdown() {
return (
<select value={this.props.selected} onChange={event => this.props.changeSelected(event.target.value)}>
<select value={this.props.selected} onChange={this.onChange}>
{this.props.user.keys.map(key => (
<option
onClick={event => this.props.changeSelected(event.target.innerText)}
key={key.name}
value={key.name}
>
Expand All @@ -87,7 +91,6 @@ class Variable extends React.Component {
<span
className="variable-underline"
onClick={this.toggleVarDropdown}
ref={this.variableElement}
>
{selectedValue[variable]}
</span>
Expand Down

0 comments on commit acf255f

Please sign in to comment.