From 99e0b88ae8094e8e9b1a4bca9dd578d87dead644 Mon Sep 17 00:00:00 2001 From: Louis Li Date: Fri, 12 Jun 2020 11:10:27 +0300 Subject: [PATCH] Update README to reflect lack of filter scoping See comments on #276 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9474e83c..26872778 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ section on the hotkeys documentation for more info. gets hit by the user. **Important:** Since version 1.5.0 this callback gets memoised inside the hook. So you don't have to do this anymore by yourself. - `options: Options = {}` - - `filter: (event: KeyboardEvent): boolean` is used to enable hotkeys inside input elements. Check out [hotkeys docs](https://github.com/jaywcjlove/hotkeys/#filter) for usage - - * `enableOnTags: string[]` is used to enable listening to hotkeys in form fields. Available values are `INPUT`, `TEXTAREA` and `SELECT`. **IMPORTANT!** When you provide a custom `filter` implementation function this parameter will be ignored. + - `filter: (event: KeyboardEvent): boolean` is used to enable hotkeys inside input elements. Check out [hotkeys docs](https://github.com/jaywcjlove/hotkeys/#filter) for usage. Due to constraints with the base library, `filter` is a global setting. As a result, it is currently not possible to have different filters for separate calls of `useHotkey`. + - * `enableOnTags: string[]` is used to enable listening to hotkeys in form fields. Available values are `INPUT`, `TEXTAREA` and `SELECT`. **IMPORTANT!** When you provide a custom `filter` implementation function this parameter will be ignored. Similar to `filter`, setting this option will enable it globally. - `splitKey: string` is used to change the splitting character inside the keys argument. Default is `+`, but if you want to listen to the `+` character, you can set `splitKey` to i.e. `-` and listen for `ctrl-+` - `keyup: boolean` Determine if you want to listen on the keyup event