fixing page reload on search request
This commit is contained in:
parent
105ff79893
commit
72c68d8a7c
@ -124,13 +124,14 @@ class HomePage extends React.Component {
|
|||||||
<div className='pageheader'>
|
<div className='pageheader'>
|
||||||
<span className='pageheadertitle'>Home Page</span>
|
<span className='pageheadertitle'>Home Page</span>
|
||||||
<span className='pageheadersubtitle'>{this.state.tag} Videos - {this.state.selectionnr}</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"
|
<input data-testid='searchtextfield' className="form-control mr-sm-2"
|
||||||
type="text" placeholder="Search"
|
type="text" placeholder="Search"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
this.keyword = e.target.value
|
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)
|
this.searchVideos(this.keyword)
|
||||||
}}>Search
|
}}>Search
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
Reference in New Issue
Block a user