Skip to content

Commit

Permalink
add preventDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNordicMule committed Jun 16, 2020
1 parent 9813b7e commit a2fe417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class MusicPlayer extends React.Component {
event.preventDefault();
this.setState({
music: event.target.music.value,
lyrics: String(event.target.lyrics.value),
lyrics: event.target.lyrics.value,
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default class NavBar extends React.Component {
}

changeLyrics(e) {
e.preventDefault();
this.setState({ lyrics: e.target.value });
}

Expand Down Expand Up @@ -101,7 +102,7 @@ export default class NavBar extends React.Component {
as="textarea"
rows="30"
cols="100"
value={this.state.lyrics}
defaultValue={this.props.lyrics}
name="modifiedLyrics"
onChange={this.changeLyrics}
/>
Expand Down

0 comments on commit a2fe417

Please sign in to comment.