Skip to content

Commit a5351e4

Browse files
authored
fix: disable button if no summit is selected to avoid error (#179)
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
1 parent fac0234 commit a5351e4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/summit-dropdown/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export default class SummitDropdown extends React.Component {
4747
).map(s => ({label: s.name, value: s.id}));
4848

4949
let bigClass = this.props.hasOwnProperty('big') ? 'big' : '';
50+
const isDisabled = !this.state.summitValue;
5051

5152
return (
5253
<div className={"summit-dropdown btn-group " + bigClass}>
@@ -59,7 +60,7 @@ export default class SummitDropdown extends React.Component {
5960
className="btn-group summit-select text-left"
6061
isClearable={false}
6162
/>
62-
<button type="button" className={`btn btn-default ${actionClass}`} onClick={this.handleClick}>
63+
<button type="button" className={`btn btn-default ${actionClass}`} disabled={isDisabled} onClick={this.handleClick}>
6364
{actionLabel}
6465
</button>
6566
</div>

0 commit comments

Comments
 (0)