Skip to content

Commit

Permalink
Components: Warn about KeyboardShortcuts prop updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Oct 17, 2017
1 parent 9314146 commit 2601680
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/keyboard-shortcuts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class SelectAllDetection extends Component {
}
```
__Note:__ The value of each shortcut should be a consistent function reference, not an anonymous function. Otherwise, the callback will not be correctly unbound when the component unmounts.
## Props
The component accepts the following props:
Expand All @@ -49,6 +47,10 @@ An object of shortcut bindings, where each key is a keyboard combination, the va
- Type: `Object`
- Required: No
__Note:__ The value of each shortcut should be a consistent function reference, not an anonymous function. Otherwise, the callback will not be correctly unbound when the component unmounts.
__Note:__ The `KeyboardShortcuts` component will not update to reflect a changed `shortcuts` prop. If you need to change shortcuts, mount a separate `KeyboardShortcuts` element, which can be achieved by assigning a unique `key` prop.
## bindGlobal
By default, a callback will not be invoked if the key combination occurs in an editable field. Pass `bindGlobal` as `true` if the key events should be observed globally, including within editable fields.
Expand Down

0 comments on commit 2601680

Please sign in to comment.