mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 18:30:53 +00:00
[keypress] replaced 'onKeyPress' with 'onKeyDown' as 'keypress' is de… (#5764)
* [keypress] replaced 'onKeyPress' with 'onKeyDown' as 'keypress' is deprecated * cleaned up code
This commit is contained in:
@@ -38,7 +38,7 @@ class CreateDepartmentRepoDialog extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -81,7 +81,7 @@ class CreateDepartmentRepoDialog extends React.Component {
|
||||
<Label for="repo-name">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repo-name"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleChange}
|
||||
maxLength={maxFileName}
|
||||
|
@@ -67,7 +67,7 @@ class CreateFile extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -151,7 +151,7 @@ class CreateFile extends React.Component {
|
||||
<Label for="fileName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="fileName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
innerRef={this.newInput}
|
||||
value={this.state.childName}
|
||||
onChange={this.handleChange}
|
||||
|
@@ -60,7 +60,7 @@ class CreateForder extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -87,7 +87,7 @@ class CreateForder extends React.Component {
|
||||
<Input
|
||||
id="folderName"
|
||||
value={this.state.childName}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
/>
|
||||
|
@@ -57,7 +57,7 @@ class CreateRepoDialog extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -180,7 +180,7 @@ class CreateRepoDialog extends React.Component {
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleRepoNameChange}
|
||||
autoFocus={true}
|
||||
|
@@ -59,7 +59,7 @@ class CreateTagDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.createTag();
|
||||
}
|
||||
@@ -77,7 +77,7 @@ class CreateTagDialog extends React.Component {
|
||||
<div role="form" className="tag-create">
|
||||
<div className="form-group">
|
||||
<label className="form-label">{gettext('Name')}</label>
|
||||
<Input onKeyPress={this.handleKeyPress} autoFocus={true} value={this.state.tagName} onChange={this.inputNewName}/>
|
||||
<Input onKeyDown={this.handleKeyDown} autoFocus={true} value={this.state.tagName} onChange={this.inputNewName}/>
|
||||
<div className="mt-2"><span className="error">{this.state.errorMsg}</span></div>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
|
@@ -35,7 +35,7 @@ class LibDecryptDialog extends React.Component {
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit(e);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class LibDecryptDialog extends React.Component {
|
||||
{this.state.showError &&
|
||||
<p className="error">{gettext('Wrong password')}</p>
|
||||
}
|
||||
<input type="password" name="password" className="form-control password-input" autoComplete="off" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange} />
|
||||
<input type="password" name="password" className="form-control password-input" autoComplete="off" onKeyDown={this.handleKeyDown} placeholder={gettext('Password')} onChange={this.handleChange} />
|
||||
<button type="submit" className="btn btn-primary submit" onClick={this.handleSubmit}>{gettext('Submit')}</button>
|
||||
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
|
||||
</Form>
|
||||
|
@@ -68,7 +68,7 @@ class LibHistorySetting extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.submit();
|
||||
e.preventDefault();
|
||||
@@ -139,7 +139,7 @@ class LibHistorySetting extends React.Component {
|
||||
value={this.state.expireDays}
|
||||
onChange={this.onChange}
|
||||
disabled={this.state.disabled}
|
||||
onKeyDown={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
/>{' '}
|
||||
<Label><span>{gettext('days')}</span></Label>
|
||||
</FormGroup>
|
||||
|
@@ -65,7 +65,7 @@ class LibOldFilesAutoDelDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.submit();
|
||||
e.preventDefault();
|
||||
@@ -112,7 +112,7 @@ class LibOldFilesAutoDelDialog extends React.Component {
|
||||
value={this.state.autoDelDays}
|
||||
disabled={!this.state.isAutoDel}
|
||||
onChange={this.onChange}
|
||||
onKeyDown={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
/>{' '}
|
||||
<Label><span>{gettext('days')}</span></Label>
|
||||
</FormGroup>
|
||||
|
@@ -32,7 +32,7 @@ class NewWikiDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class NewWikiDialog extends React.Component {
|
||||
<ModalHeader toggle={this.toggle}>{gettext('New Wiki')}</ModalHeader>
|
||||
<ModalBody>
|
||||
<label className="form-label">{gettext('Name')}</label>
|
||||
<Input onKeyPress={this.handleKeyPress} autoFocus={true} value={this.state.name} onChange={this.inputNewName}/>
|
||||
<Input onKeyDown={this.handleKeyDown} autoFocus={true} value={this.state.name} onChange={this.inputNewName}/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
|
||||
|
@@ -55,7 +55,7 @@ class AddDepartDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -73,7 +73,7 @@ class AddDepartDialog extends React.Component {
|
||||
<Label for="departName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="departName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.departName}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
|
@@ -51,7 +51,7 @@ class AddRepoDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -68,7 +68,7 @@ class AddRepoDialog extends React.Component {
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
|
@@ -34,13 +34,6 @@ class AddOrgUserDialog extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
e.preventDefault();
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit(e);
|
||||
}
|
||||
};
|
||||
|
||||
togglePasswordVisible = () => {
|
||||
this.setState({isPasswordVisible: !this.state.isPasswordVisible}, () => {
|
||||
if (this.state.isPasswordVisible) {
|
||||
|
@@ -63,7 +63,7 @@ class RenameDepartmentDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -87,7 +87,7 @@ class RenameDepartmentDialog extends React.Component {
|
||||
<Label for="departmentName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="departmentName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.departmentName}
|
||||
onChange={this.handleChange}
|
||||
innerRef={this.newInput}
|
||||
|
@@ -46,7 +46,7 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
this.setState({ quota: quota });
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.setGroupQuota();
|
||||
e.preventDefault();
|
||||
@@ -60,7 +60,7 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
<ModalBody>
|
||||
<InputGroup>
|
||||
<Input
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.quota}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
|
@@ -62,7 +62,7 @@ class Rename extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
}
|
||||
@@ -121,7 +121,7 @@ class Rename extends React.Component {
|
||||
<ModalHeader toggle={this.toggle}>{type === 'file' ? gettext('Rename File') : gettext('Rename Folder') }</ModalHeader>
|
||||
<ModalBody>
|
||||
<p>{type === 'file' ? gettext('New file name'): gettext('New folder name')}</p>
|
||||
<Input onKeyPress={this.handleKeyPress} innerRef={this.newInput} placeholder="newName" value={this.state.newName} onChange={this.handleChange} />
|
||||
<Input onKeyDown={this.handleKeyDown} innerRef={this.newInput} placeholder="newName" value={this.state.newName} onChange={this.handleChange} />
|
||||
{this.state.errMessage && <Alert color="danger" className="mt-2">{this.state.errMessage}</Alert>}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
@@ -63,7 +63,7 @@ class Rename extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
}
|
||||
@@ -123,7 +123,7 @@ class Rename extends React.Component {
|
||||
<ModalHeader toggle={this.toggle}>{type === 'file' ? gettext('Rename File') : gettext('Rename Folder') }</ModalHeader>
|
||||
<ModalBody>
|
||||
<p>{type === 'file' ? gettext('New file name'): gettext('New folder name')}</p>
|
||||
<Input onKeyPress={this.handleKeyPress} innerRef={this.newInput} value={this.state.newName} onChange={this.handleChange} />
|
||||
<Input onKeyDown={this.handleKeyDown} innerRef={this.newInput} value={this.state.newName} onChange={this.handleChange} />
|
||||
{this.state.errMessage && <Alert color="danger" className="mt-2">{this.state.errMessage}</Alert>}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
@@ -30,7 +30,7 @@ class SetQuotaDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -55,7 +55,7 @@ class SetQuotaDialog extends React.Component {
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={quota}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
onChange={this.handleQuotaChange}
|
||||
/>
|
||||
<InputGroupAddon addonType="append">
|
||||
|
@@ -31,7 +31,7 @@ class SysAdminSetUploadDownloadRateLimitDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -56,7 +56,7 @@ class SysAdminSetUploadDownloadRateLimitDialog extends React.Component {
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={rateLimit}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
onChange={this.handleRateLimitChange}
|
||||
/>
|
||||
<InputGroupAddon addonType="append">
|
||||
|
@@ -55,7 +55,7 @@ class AddDepartDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -73,7 +73,7 @@ class AddDepartDialog extends React.Component {
|
||||
<Label for="departName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="departName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.departName}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
|
@@ -51,7 +51,7 @@ class AddRepoDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -68,7 +68,7 @@ class AddRepoDialog extends React.Component {
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
|
@@ -34,13 +34,6 @@ class SysAdminBatchAddAdminDialog extends React.Component {
|
||||
this.toggle();
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal isOpen={true} toggle={this.toggle}>
|
||||
|
@@ -44,7 +44,7 @@ class SysAdminCreateGroupDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -65,7 +65,7 @@ class SysAdminCreateGroupDialog extends React.Component {
|
||||
<Label for="groupName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="groupName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.groupName}
|
||||
onChange={this.handleRepoNameChange}
|
||||
autoFocus={true}
|
||||
|
@@ -42,7 +42,7 @@ class SysAdminCreateRepoDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -63,7 +63,7 @@ class SysAdminCreateRepoDialog extends React.Component {
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleRepoNameChange}
|
||||
autoFocus={true}
|
||||
|
@@ -68,7 +68,7 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.submit();
|
||||
e.preventDefault();
|
||||
@@ -132,7 +132,7 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
||||
value={this.state.expireDays}
|
||||
onChange={this.onChange}
|
||||
disabled={this.state.disabled}
|
||||
onKeyDown={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
/>{' '}
|
||||
<Label><span>{gettext('days')}</span></Label>
|
||||
</FormGroup>
|
||||
|
@@ -58,7 +58,7 @@ class RenameDepartmentDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -82,7 +82,7 @@ class RenameDepartmentDialog extends React.Component {
|
||||
<Label for="departmentName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="departmentName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.departmentName}
|
||||
onChange={this.handleChange}
|
||||
innerRef={this.newInput}
|
||||
|
@@ -46,7 +46,7 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
this.setState({ quota: quota });
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.setGroupQuota();
|
||||
e.preventDefault();
|
||||
@@ -60,7 +60,7 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
<ModalBody>
|
||||
<InputGroup>
|
||||
<Input
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.quota}
|
||||
onChange={this.handleChange}
|
||||
autoFocus={true}
|
||||
|
@@ -31,7 +31,7 @@ class SysAdminSetOrgMaxUserNumberDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -55,7 +55,7 @@ class SysAdminSetOrgMaxUserNumberDialog extends React.Component {
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={value}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
@@ -31,7 +31,7 @@ class SysAdminSetOrgNameDialog extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -54,7 +54,7 @@ class SysAdminSetOrgNameDialog extends React.Component {
|
||||
<Input
|
||||
type="text"
|
||||
value={name}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
@@ -27,7 +27,7 @@ class UpdateUser extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -50,7 +50,7 @@ class UpdateUser extends React.Component {
|
||||
<Input
|
||||
type="text"
|
||||
value={this.state.value}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
@@ -24,7 +24,7 @@ class Search extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
e.preventDefault();
|
||||
this.handleSubmit();
|
||||
@@ -50,7 +50,7 @@ class Search extends React.Component {
|
||||
placeholder={this.props.placeholder}
|
||||
value={this.state.value}
|
||||
onChange={this.handleInputChange}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
autoComplete="off"
|
||||
/>
|
||||
</div>
|
||||
|
@@ -29,7 +29,7 @@ class Search extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
e.preventDefault();
|
||||
this.handleSubmit();
|
||||
@@ -55,7 +55,7 @@ class Search extends React.Component {
|
||||
placeholder={this.props.placeholder}
|
||||
value={this.state.value}
|
||||
onChange={this.handleInputChange}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
autoComplete="off"
|
||||
/>
|
||||
</div>
|
||||
|
@@ -21,7 +21,7 @@ class Search extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
e.preventDefault();
|
||||
this.handleSubmit();
|
||||
@@ -47,7 +47,7 @@ class Search extends React.Component {
|
||||
placeholder={this.props.placeholder}
|
||||
value={this.state.value}
|
||||
onChange={this.handleInputChange}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
autoComplete="off"
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user