Skip to content

Commit cf9e198

Browse files
Merge pull request #46 from plotly/hotfixSelector
remove FieldBase from Select component
2 parents 240362b + a1af46a commit cf9e198

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/components/Select.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import React, { Component } from "react";
2-
import FieldBase from "./FieldBase";
3-
import { bem } from "../lib";
1+
import React, {Component} from 'react';
2+
import {bem, connectToPlot} from '../lib';
43

5-
class Select extends FieldBase {
4+
class Select extends Component {
65
renderOption(attrs, i) {
76
return (
87
<option key={`option-${i}`} value={attrs.value}>
@@ -16,7 +15,7 @@ class Select extends FieldBase {
1615

1716
for (let i = 0; i < options.length; i++) {
1817
let opt = options[i];
19-
if (typeof opt !== "object") {
18+
if (typeof opt !== 'object') {
2019
options[i] = {
2120
label: opt,
2221
value: opt,
@@ -25,16 +24,16 @@ class Select extends FieldBase {
2524
}
2625

2726
if (this.props.hasBlank) {
28-
options.unshift({ label: "", value: "" });
27+
options.unshift({label: '', value: ''});
2928
}
3029

3130
return (
32-
<label className={bem("field")}>
33-
<span className={bem("field", "title")}>{this.props.label}</span>
31+
<label className={bem('field')}>
32+
<span className={bem('field', 'title')}>{this.props.label}</span>
3433

3534
<select
3635
value={this.fullValue}
37-
className={bem("field", "control")}
36+
className={bem('field', 'control')}
3837
onChange={e => this.updatePlot(e.target.value)}
3938
>
4039
{options.map(this.renderOption)}
@@ -44,4 +43,4 @@ class Select extends FieldBase {
4443
}
4544
}
4645

47-
export default Select;
46+
export default connectToPlot(Select);

0 commit comments

Comments
 (0)