mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 07:30:00 +00:00
Added more webdriver tests testing against a real browser.
This commit is contained in:
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
|
||||
|
||||
class StringInput extends React.Component {
|
||||
static propTypes = {
|
||||
"data-wd-key": PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
style: PropTypes.object,
|
||||
default: PropTypes.string,
|
||||
@@ -18,6 +19,7 @@ class StringInput extends React.Component {
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
console.log("@@ STRING componentWillReceiveProps", JSON.stringify(nextProps))
|
||||
this.setState({ value: nextProps.value || '' })
|
||||
}
|
||||
|
||||
@@ -40,12 +42,19 @@ class StringInput extends React.Component {
|
||||
}
|
||||
|
||||
return React.createElement(tag, {
|
||||
"data-wd-key": this.props["data-wd-key"],
|
||||
className: classes.join(" "),
|
||||
style: this.props.style,
|
||||
value: this.state.value,
|
||||
placeholder: this.props.default,
|
||||
onChange: e => this.setState({ value: e.target.value }),
|
||||
onChange: e => {
|
||||
console.log("@@ STRING CHANGE", JSON.stringify(e.target.value));
|
||||
this.setState({
|
||||
value: e.target.value
|
||||
})
|
||||
},
|
||||
onBlur: () => {
|
||||
console.log("@@ STRING BLUR", JSON.stringify(this.state.value), "props:", JSON.stringify(this.props.value));
|
||||
if(this.state.value!==this.props.value) this.props.onChange(this.state.value)
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user