Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
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
Expand Up @@ -34,6 +34,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix `pxToRem` referenced for `Dropdown` component styles @kuzhelov ([#590](https://github.com/stardust-ui/react/pull/590))
- Fix `Popup` logic of handling `content` value provided as React element @kuzhelov ([#592](https://github.com/stardust-ui/react/pull/592))
- Do not handle `FocusZone`'s keyDownCapture in `chatBehavior` @sophieH29 ([#563](https://github.com/stardust-ui/react/pull/563))
- Fix `getKeyDownHandler` to pass props for client's onKeyDown handler @sophieH29 ([#595](https://github.com/stardust-ui/react/pull/595))

### Features
- `Ref` components uses `forwardRef` API by default @layershifter ([#491](https://github.com/stardust-ui/react/pull/491))
Expand Down
2 changes: 1 addition & 1 deletion src/lib/getKeyDownHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getKeyDownHandlers = (
eventHandler && eventHandler(event)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to add the props to the eventHandler as well? We can define then the actions in the following manner:

  protected actionHandlers: AccessibilityActionHandlers = {
    performClick: (event, props) => this.handleClick(event, props),
  }

Not sure, if the previous definition with the event is necessary:

  protected actionHandlers: AccessibilityActionHandlers = {
    performClick: event => this.handleClick(event),
  }

because the event is send in the getKeyDownHandler, I don't see why we cannot send the props too. Let me know if this works and make sense (it makes sense in my opinion, as we would have unified way of defining the handlers).

Copy link
Contributor

Choose a reason for hiding this comment

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

Disregard my comment, I was mixing it with other problems. The changes for this PR are sufficient 👍

})

_.invoke(props, 'onKeyDown', event)
_.invoke(props, 'onKeyDown', event, props)
},
}
}
Expand Down