react-shortcuts
react-shortcuts copied to clipboard
Readme updates
This pull request includes, imho, a bunch of improvements to the project's readme.
I gathered this information by:
- Using and experimenting with the package (master - not the latest version on npm)
- Reading through the test suite
- Reading through the source code (and the source code of some of the dependencies)
I believe it's all correct, but I can't guarantee that there are no misunderstandings or errors contained within.
Open to suggestions for changes of formatting, rewording, corrections or anything, really.
What's changed
Document structure
- Introduced some more logical structer and recognisable section headings for users skim reading the documentation
- Applied markdown more consistently for headings
- Made it more apparent that React Shortcuts is based on Atom's keymaps (a name people will recognise and trust)
- May have reordered some sections for document flow - I can't remember
- Fixed typos and formatting issues
- Added a lot of local links, so relevant information and elaborations can be easily followed without duplication
How it works section
- Explained the relationship between
<Shortcuts>and the contents of the keymap - Explained the order used for matching keyboard shortcuts (particularly relevant for nested
<Shortcuts>) - Explained the default behaviour and what happens when you use the
stopPropagationandglobalproperties in terms of triggering and propagation events
Integrating with existing onKeyDown, onKeyUp and onKeyPress handlers
- Explained the default behaviour of React shortcuts with regular React key listeners and how to change it using the
isolateprop
Handler function section
- Explained when a shortcut handler is and is not called, linking to relevant sections for ellaboration
<Shortcuts>'s props
- Moved into a table for easier reading
- Added a default value for all props (where applicable)
- Improved the description of each, linking to relevant ellaborations
Managing focus in the browser
- Explained how browser focus works and the role that
tabindexplays - this section is somewhat like an appendix but ended up being pre-requisite knowledge for understanding how to use this package for me, so I think it has a place in the readme - Linked to relevant sections and behaviour of React Shortcuts
Troubleshooting section
- Added troubleshooting section for problems I encountered while using this project (and those I have seen others experience)
- Now discoverable by browsing or using the browser's search function
Let me know what you think. :)