SDA-4253 - Handle key down on pod input (#1928)

Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com>
This commit is contained in:
Kiran Niranjan 2023-08-04 14:47:45 +05:30 committed by GitHub
parent 53b9e9a8ca
commit 28650d9c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,6 +265,18 @@ export default class AboutApp extends React.Component<{}, IState> {
this.setState({ updatedHostname: value });
};
/**
* Handles key down on input
* @param e
*/
public onKeyDown = (e) => {
if (e.keyCode === 13) {
const { value } = e.target;
this.setState({ updatedHostname: value });
this.handlePodInputBlur(e);
}
};
/**
* Validates and sets new hostname
*/
@ -329,6 +341,7 @@ export default class AboutApp extends React.Component<{}, IState> {
className={'AboutApp-pod-input'}
type='text'
value={updatedHostname}
onKeyDown={this.onKeyDown}
onChange={this.handlePodChange}
onBlur={this.handlePodInputBlur}
autoFocus