Skip to content

Commit

Permalink
fix history between keyboard/mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
idomusha committed Feb 27, 2020
1 parent 7d92f5e commit aa246af
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
### Removed
-->

## [2.0.0-beta.1] - 2020-02-16
## [2.0.0-beta.2] - 2020-02-26

### Fixed

- History between keyboard and mouse

## [2.0.0-beta.1] - 2020-02-26

### Added

Expand Down
10 changes: 8 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-interaction",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"private": false,
"description": "React hook for getting and following user interaction type",
"keywords": [
Expand Down
6 changes: 1 addition & 5 deletions src/useInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const useInteraction = ({ initial = null } = {}) => {
...(['touchstart', 'keydown'].includes(event.type) && {
[event.type]: true,
[['touchstart', 'keydown'].find(e => e !== event.type)]: null,
mousemove: false,
mousemove: event.type === 'touchstart' ? false : null,
wheel: null,
}),
...(event.type === 'mousemove' && {
Expand Down Expand Up @@ -155,10 +155,6 @@ const useInteraction = ({ initial = null } = {}) => {
}
}, [firedEvent, handleInteractionMouse])

useEffect(() => {
log.log([pointerType, [...pointerHistory], pointerAccuracy])
}, [pointerType, pointerHistory, pointerAccuracy])

useEffect(() => {
log.info('firedEvent', { ...firedEvent })

Expand Down

0 comments on commit aa246af

Please sign in to comment.