mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-08-09 04:37:15 +00:00
pass the event arguemnt and preventDefault
This commit is contained in:
parent
11dc6a48bd
commit
d43a2ade4b
2 changed files with 6 additions and 5 deletions
|
|
@ -7,15 +7,15 @@ const styles = require('./styles');
|
|||
|
||||
const Button = React.forwardRef(({ className, href, disabled, children, onLongPress, ...props }, ref) => {
|
||||
let pressTimer = null;
|
||||
const onTouchStart = function () {
|
||||
const onTouchStart = function (event) {
|
||||
pressTimer = setTimeout(function () {
|
||||
if (typeof onLongPress === 'function') {
|
||||
//alert('longpress detected');
|
||||
onLongPress();
|
||||
onLongPress(event);
|
||||
}
|
||||
}, 650); // an artifact of previous menus staying on the screen will happen on Safari if the timeout was set to 600 and less, and 650 for PWA.
|
||||
};
|
||||
const onTouchEnd = function () {
|
||||
const onTouchEnd = function (event) {
|
||||
//event.preventDefault();
|
||||
clearTimeout(pressTimer);
|
||||
};
|
||||
const onKeyDown = React.useCallback((event) => {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ const Video = ({ className, id, title, thumbnail, episode, released, upcoming, w
|
|||
toggleMenu();
|
||||
}
|
||||
}, [toggleMenu]);
|
||||
const popupLabelOnLongPress = React.useCallback(() => {
|
||||
const popupLabelOnLongPress = React.useCallback((event) => {
|
||||
event.preventDefault();
|
||||
toggleMenu();
|
||||
}, [toggleMenu]);
|
||||
const popupMenuOnContextMenu = React.useCallback((event) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue