Use select value to avoid react warning
This commit is contained in:
@@ -80,12 +80,12 @@ export default class Topbar extends React.Component {
|
|||||||
if(urls) {
|
if(urls) {
|
||||||
let rows = []
|
let rows = []
|
||||||
urls.forEach((link, i) => {
|
urls.forEach((link, i) => {
|
||||||
rows.push(<option key={i} value={link.url} selected={i===this.state.selectedIndex}>{link.name}</option>)
|
rows.push(<option key={i} value={link.url}>{link.name}</option>)
|
||||||
})
|
})
|
||||||
|
|
||||||
control.push(
|
control.push(
|
||||||
<label className="select-label" htmlFor="select"><span>Select a spec</span>
|
<label className="select-label" htmlFor="select"><span>Select a spec</span>
|
||||||
<select id="select" disabled={isLoading} onChange={ this.onUrlSelect }>
|
<select id="select" disabled={isLoading} onChange={ this.onUrlSelect } value={urls[this.state.selectedIndex].url}>
|
||||||
{rows}
|
{rows}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user