-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Display warning banner when removing a host isola…
…tion exception (#121729)
- Loading branch information
Showing
8 changed files
with
114 additions
and
58 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
.../plugins/security_solution/public/common/components/autofocus_button/autofocus_button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiButton, EuiButtonProps, PropsForButton } from '@elastic/eui'; | ||
import React, { FC, memo, useEffect, useRef } from 'react'; | ||
|
||
export const AutoFocusButton: FC<PropsForButton<EuiButtonProps>> = memo((props) => { | ||
const buttonRef = useRef<HTMLButtonElement>(null); | ||
const button = <EuiButton buttonRef={buttonRef} {...props} />; | ||
|
||
useEffect(() => { | ||
if (buttonRef.current) { | ||
buttonRef.current.focus(); | ||
} | ||
}, []); | ||
|
||
return button; | ||
}); | ||
|
||
AutoFocusButton.displayName = 'AutoFocusButton'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters