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

feat(react-grid): support expanding/collapsing detail rows with keyboard #446

Merged
merged 5 commits into from
Oct 27, 2017
Merged

feat(react-grid): support expanding/collapsing detail rows with keyboard #446

merged 5 commits into from
Oct 27, 2017

Conversation

MaximKudriavtsev
Copy link
Contributor

No description provided.

/>
</td>
);
onKeyDown={handleKeyDown}
Copy link
Contributor

@gsobolev gsobolev Oct 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not subscribe the element with tabIndex on these events?

const handleBlur = (e) => {
e.target.style.outline = '';
};
const handleMouseDownChildren = (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this handler?

style={style}
>
<IconButton
tabIndex={0} // eslint-disable-line jsx-a11y/no-noninteractive-tabindex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is no need to explicitly specify the tabIndex property for the button element. It can get focus by default.

marginLeft: '-6px',
height: theme.spacing.unit * 6,
width: theme.spacing.unit * 6,
marginLeft: '-18px',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not it possible to use theme.spacing.unit here?

textOverflow: 'initial',
paddingTop: '0px',
paddingBottom: '0px',
},
toggleCellIcon: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename this property to "toggleCellButton"?


export const TableDetailToggleCell = ({ style, expanded, toggleExpanded }) => {
const handleKeyDown = (event) => {
if (event.keyCode === 13) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract the "magic number" to a human-readable constant.

.toBe(0);
});

it('should handle the "Enter" key down', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Enter" and "Space" keys

@MaximKudriavtsev MaximKudriavtsev merged commit 47ab49d into DevExpress:master Oct 27, 2017
@MaximKudriavtsev MaximKudriavtsev deleted the keyBordNavigation-TableRowDetail branch November 14, 2017 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants