Skip to content

Commit

Permalink
Added onFocus and onBlur
Browse files Browse the repository at this point in the history
  • Loading branch information
adirhaz1z committed Apr 8, 2021
1 parent 41243df commit c954722
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ type Props = {
'aria-readonly'?: boolean,
'aria-activedescendant'?: string,

/** Callback invoked when list is focused. */
onFocus: (params: Event) => void,

/** Callback invoked when list is blured. */
onBlur: (params: Event) => void,

/**
* Set the width of the inner scrollable container to 'auto'.
* This is useful for single-column Grids to ensure that the column doesn't extend below a vertical scrollbar.
Expand Down Expand Up @@ -1054,6 +1060,8 @@ class Grid extends React.PureComponent<Props, State> {
...gridStyle,
...style,
}}
onFocus={this.props['onFocus']}
onBLur={this.props['onBlur']}
tabIndex={tabIndex}>
{childrenToDisplay.length > 0 && (
<div
Expand Down
7 changes: 6 additions & 1 deletion source/List/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ type Props = {
/** Optional renderer to be used in place of rows when rowCount is 0 */
noRowsRenderer: NoContentRenderer,

/** Callback invoked with information about the slice of rows that were just rendered. */
/** Callback invoked when list is focused. */
onFocus: (params: Event) => void,

/** Callback invoked when list is blured. */
onBlur: (params: Event) => void,

/** Callback invoked with information about the slice of rows that were just rendered. */
onRowsRendered: (params: RenderedRows) => void,

/**
Expand Down

0 comments on commit c954722

Please sign in to comment.