Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds initialFocus prop typedefs #1410

Merged
merged 6 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
7 changes: 7 additions & 0 deletions src/components/modal/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CommonProps, Omit } from '../common';
/// <reference path="../button/index.d.ts" />

import { FocusTarget } from 'focus-trap';
import { ReactNode, SFC, HTMLAttributes } from 'react';

declare module '@elastic/eui' {
Expand All @@ -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<
Expand Down
2 changes: 2 additions & 0 deletions src/components/popover/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CommonProps, NoArgCallback } from '../common';
/// <reference path="../panel/index.d.ts" />

import { FocusTarget } from 'focus-trap';
import { SFC, ReactNode, HTMLAttributes } from 'react';

declare module '@elastic/eui' {
Expand Down Expand Up @@ -31,6 +32,7 @@ declare module '@elastic/eui' {
withTitle?: boolean;
isOpen?: boolean;
ownFocus?: boolean;
initialFocus?: FocusTarget;
hasArrow?: boolean;
anchorClassName?: string;
anchorPosition?: PopoverAnchorPosition;
Expand Down