Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Define navigator.maxTouchPoints as 0 when unknown
Browse files Browse the repository at this point in the history
Fixes gh-332
Closes gh-335
  • Loading branch information
scottgonzalez committed Apr 10, 2017
1 parent d1aa08d commit b684991
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Touches will not generate events unless inside of an area that has a valid `touc

## navigator.maxTouchPoints

As the information necessary to populate [`navigator.maxTouchPoints`](https://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface) is not available in browsers that do not natively implement pointer events, PEP does not currently polyfill this extension to the `navigator` interface.
As the information necessary to populate [`navigator.maxTouchPoints`](https://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface) is not available in browsers that do not natively implement pointer events, PEP sets the value to `0`, which is "the minimum number guaranteed to be recognized" as required by the specification.

### Browser Compatibility

Expand Down
4 changes: 4 additions & 0 deletions src/platform-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export function applyPolyfill() {
});
dispatcher.registerSource('ms', msEvents);
} else {
Object.defineProperty(window.navigator, 'maxTouchPoints', {
value: 0,
enumerable: true
});
dispatcher.registerSource('mouse', mouseEvents);
if (window.ontouchstart !== undefined) {
dispatcher.registerSource('touch', touchEvents);
Expand Down

0 comments on commit b684991

Please sign in to comment.