mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
[mapbox] fix viewport alterations (#3293)
* [mapbox] fix viewport alterations Since explorev2 it appears that altering the viewport hasn't been changing the controls as it used to. This PR addresses it. * lint
This commit is contained in:
committed by
GitHub
parent
d1d1c49009
commit
ccf505a480
@@ -29,13 +29,10 @@ const defaultProps = {
|
||||
export default class TextControl extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const value = props.value ? props.value.toString() : '';
|
||||
this.state = { value };
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
onChange(event) {
|
||||
let value = event.target.value || '';
|
||||
this.setState({ value });
|
||||
|
||||
// Validation & casting
|
||||
const errors = [];
|
||||
@@ -58,6 +55,7 @@ export default class TextControl extends React.Component {
|
||||
this.props.onChange(value, errors);
|
||||
}
|
||||
render() {
|
||||
const value = this.props.value ? this.props.value.toString() : '';
|
||||
return (
|
||||
<div>
|
||||
<ControlHeader {...this.props} />
|
||||
@@ -66,7 +64,7 @@ export default class TextControl extends React.Component {
|
||||
type="text"
|
||||
placeholder=""
|
||||
onChange={this.onChange}
|
||||
value={this.state.value}
|
||||
value={value}
|
||||
/>
|
||||
</FormGroup>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user