-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error should be raised when we try to set slider of output variable [#19] #35
Changes from 2 commits
6e1c43b
88260cd
d69db8a
b65b24a
c21b38f
b40794f
5d8b095
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,16 @@ | |
text-align: center; | ||
} | ||
|
||
.Burst-dropdown { | ||
height: 33px; | ||
width: 114px; | ||
margin-bottom: 15px; | ||
margin-top: 5px; | ||
border: 1px solid #000; | ||
font-size: 1em; | ||
outline: none !important; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the reason behind this (outline)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
.Burst-input-error { | ||
border-color: #cc0000; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ import './Burst.css'; | |
class Burst extends Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
idx: 1, | ||
idx: null, | ||
min: -10, | ||
max: 10, | ||
step: 1, | ||
|
@@ -38,24 +37,32 @@ class Burst extends Component { | |
} | ||
|
||
render() { | ||
const { idx, min, max, step, errors } = this.state; | ||
const { expanded } = this.props; | ||
const { min, max, step, errors } = this.state; | ||
const { expanded, burstSliders } = this.props; | ||
|
||
if (!expanded) return <div className="Burst" />; | ||
|
||
return ( | ||
<div className={classNames('Burst', { 'Burst-expanded': expanded })}> | ||
<div>Slider Index</div> | ||
<input | ||
className={classNames('Burst-input', { | ||
'Burst-input-error': !!errors.idx | ||
})} | ||
type="number" | ||
<div>Slider</div> | ||
<select | ||
className="Burst-dropdown" | ||
name="idx" | ||
aria-label="slider index" | ||
value={isNaN(idx) ? '' : idx} | ||
onChange={this.handleInputUpdate} | ||
/> | ||
> | ||
<option value={null} defaultValue> | ||
{burstSliders.length ? 'Choose Slider' : 'No Sliders'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed to |
||
</option> | ||
{burstSliders.map(exp => { | ||
return ( | ||
<option key={`slider-${exp.id}`} value={exp.id}> | ||
{' '} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you need this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
{exp.latex.split('=').join(' = ')} | ||
</option> | ||
); | ||
})} | ||
</select> | ||
<div>Slider Min</div> | ||
<input | ||
className={classNames('Burst-input', { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the rest of this file, the actions appear to be at the top. Is there a particular reason you've placed this one apart from the rest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! moved from thunk section to action section