diff --git a/CHANGELOG.md b/CHANGELOG.md index 74feacf05d0..8c236195f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Added `onBlur` prop to `EuiComboBox` ([#1400](https://github.com/elastic/eui/pull/1400)) +- Added `initialFocus` prop typedefs to `EuiModal` and `EuiPopover` ([#1410](https://github.com/elastic/eui/pull/1410)) ## [`6.2.0`](https://github.com/elastic/eui/tree/v6.2.0) diff --git a/src/components/modal/index.d.ts b/src/components/modal/index.d.ts index 076c848cd5d..d73cb177d3e 100644 --- a/src/components/modal/index.d.ts +++ b/src/components/modal/index.d.ts @@ -1,6 +1,7 @@ import { CommonProps, Omit } from '../common'; /// +import { FocusTarget } from 'focus-trap'; import { ReactNode, SFC, HTMLAttributes } from 'react'; declare module '@elastic/eui' { @@ -20,6 +21,12 @@ declare module '@elastic/eui' { * set to a string for a custom width in custom measurement. */ maxWidth?: boolean | number | string; + + /** + * Specifies what element should initially have focus; + * Can be a DOM node, or a selector string (which will be passed to document.querySelector() to find the DOM node), or a function that returns a DOM node. + */ + initialFocus?: FocusTarget; } export const EuiModal: SFC< diff --git a/src/components/popover/index.d.ts b/src/components/popover/index.d.ts index 65e5bd57008..1a691f20f2e 100644 --- a/src/components/popover/index.d.ts +++ b/src/components/popover/index.d.ts @@ -1,6 +1,7 @@ import { CommonProps, NoArgCallback } from '../common'; /// +import { FocusTarget } from 'focus-trap'; import { SFC, ReactNode, HTMLAttributes } from 'react'; declare module '@elastic/eui' { @@ -31,6 +32,7 @@ declare module '@elastic/eui' { withTitle?: boolean; isOpen?: boolean; ownFocus?: boolean; + initialFocus?: FocusTarget; hasArrow?: boolean; anchorClassName?: string; anchorPosition?: PopoverAnchorPosition;