mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix enter key 'clicking' first button on form (#55222)
* Add type='button' in button used in Heading component to prevent having the default value ='submit' * Add type='button' for buttons used in form when grafana-managed alert type is selected * Add type='button' for buttons used in form when mimir-or-loki alert type is selected
This commit is contained in:
parent
20e6e0d593
commit
4270e5606c
@ -97,7 +97,7 @@ const Heading = ({ children, className, 'aria-label': ariaLabel }: ChildProps &
|
||||
{children}
|
||||
</a>
|
||||
) : onClick ? (
|
||||
<button onClick={onClick} className={styles.linkHack} aria-label={ariaLabel}>
|
||||
<button onClick={onClick} className={styles.linkHack} aria-label={ariaLabel} type="button">
|
||||
{children}
|
||||
</button>
|
||||
) : (
|
||||
|
@ -91,6 +91,7 @@ export const QueryEditorRowHeader = <TQuery extends DataQuery>(props: Props<TQue
|
||||
title="Edit query name"
|
||||
onClick={onEditQuery}
|
||||
data-testid="query-name-div"
|
||||
type="button"
|
||||
>
|
||||
<span className={styles.queryName}>{query.refId}</span>
|
||||
<Icon name="pen" className={styles.queryEditIcon} size="sm" />
|
||||
|
@ -297,6 +297,7 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
className="gf-form-label query-keyword pointer"
|
||||
onClick={this.onClickChooserButton}
|
||||
disabled={buttonDisabled}
|
||||
type="button"
|
||||
>
|
||||
{chooserText}
|
||||
<Icon name={labelBrowserVisible ? 'angle-down' : 'angle-right'} />
|
||||
|
Loading…
Reference in New Issue
Block a user