mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Fix focus jumps from Case description box back to Alerts table with first <return> keystroke (#111273)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
ec461a223e
commit
db07147091
2 changed files with 15 additions and 1 deletions
|
@ -113,7 +113,20 @@ export const FormContext: React.FC<Props> = ({
|
|||
: null,
|
||||
[children, connectors, isLoadingConnectors]
|
||||
);
|
||||
return <Form form={form}>{childrenWithExtraProp}</Form>;
|
||||
return (
|
||||
<Form
|
||||
onKeyDown={(e: KeyboardEvent) => {
|
||||
// It avoids the focus scaping from the flyout when enter is pressed.
|
||||
// https://github.com/elastic/kibana/issues/111120
|
||||
if (e.key === 'Enter') {
|
||||
e.stopPropagation();
|
||||
}
|
||||
}}
|
||||
form={form}
|
||||
>
|
||||
{childrenWithExtraProp}
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
FormContext.displayName = 'FormContext';
|
||||
|
|
|
@ -21,6 +21,7 @@ const TitleComponent: React.FC<Props> = ({ isLoading }) => (
|
|||
idAria: 'caseTitle',
|
||||
'data-test-subj': 'caseTitle',
|
||||
euiFieldProps: {
|
||||
autoFocus: true,
|
||||
fullWidth: true,
|
||||
disabled: isLoading,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue