Tell us what’s happening:
Instead of overwriting the 1px solid black border, the code below puts the red border INSIDE the existing black border. This still passes the automated test, but it doesn’t seem like an ideal response.
Of note, I had the same issue when I tried plugging in the actual solution answer as well.
I’m using Microsoft Edge Version 100.0.1185.29 (Official build) (64-bit) as my browser.
**Your code so far**
class GateKeeper extends React.Component {
constructor(props) {
super(props);
this.state = {
input: ''
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.setState({ input: event.target.value })
}
render() {
let inputStyle = {
border: '1px solid black'
};
// Change code below this line
if (this.state.input.length > 15) {
inputStyle = {
border: '3px solid red'
}
}
// Change code above this line
return (
<div>
<h3>Don't Type Too Much:</h3>
<input
type="text"
style={inputStyle}
value={this.state.input}
onChange={this.handleChange} />
</div>
);
}
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36 Edg/100.0.1185.29
Challenge: Change Inline CSS Conditionally Based on Component State
Link to the challenge: