add tabindex: 0 on buttons only if they have handlers

This commit is contained in:
igoradamenko
2019-01-07 00:38:43 +02:00
parent 88184fbc54
commit f2a8678715
+1 -1
View File
@@ -7,7 +7,7 @@ const handleBtnKeyPress = (event, handler) => {
export const getHandleClickProps = handler => ({
role: 'button',
tabIndex: 0,
onClick: handler,
onKeyPress: event => handleBtnKeyPress(event, handler),
...(handler ? { tabIndex: 0 } : {}),
});