Variables: Page refreshes hitting enter to select a variable value (#70996)

This commit is contained in:
Ivan Ortega Alba 2023-07-11 12:30:08 +02:00 committed by GitHub
parent d5309710cb
commit 699e499cc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,10 @@ class SubMenuUnConnected extends PureComponent<Props> {
this.forceUpdate();
};
disableSubmitOnEnter = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
};
render() {
const { dashboard, variables, links, annotations, theme } = this.props;
@ -56,7 +60,7 @@ class SubMenuUnConnected extends PureComponent<Props> {
return (
<div className={styles.submenu}>
<form aria-label="Template variables" className={styles.formStyles}>
<form aria-label="Template variables" className={styles.formStyles} onSubmit={this.disableSubmitOnEnter}>
<SubMenuItems variables={variables} readOnly={readOnlyVariables} />
</form>
<Annotations