fixing page reload on search request

This commit is contained in:
lukas 2020-06-14 22:01:13 +02:00
parent 105ff79893
commit 72c68d8a7c

View File

@ -124,13 +124,14 @@ class HomePage extends React.Component {
<div className='pageheader'>
<span className='pageheadertitle'>Home Page</span>
<span className='pageheadersubtitle'>{this.state.tag} Videos - {this.state.selectionnr}</span>
<form className="form-inline searchform" action="#">
<form className="form-inline searchform">
<input data-testid='searchtextfield' className="form-control mr-sm-2"
type="text" placeholder="Search"
onChange={(e) => {
this.keyword = e.target.value
}}/>
<button data-testid='searchbtnsubmit' className="btn btn-success" type="submit" onClick={() => {
<button data-testid='searchbtnsubmit' className="btn btn-success" type="submit" onClick={(e) => {
e.preventDefault();
this.searchVideos(this.keyword)
}}>Search
</button>