Testing the onContextMenu event.

This commit is contained in:
Eric van der Vlist 2022-11-17 23:33:57 +01:00
parent 8906bed1e7
commit c731c6a7e6
2 changed files with 16 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import { Point } from './types';
import './Handler.css';
import { handlersConfig } from './config';
import { Transformation } from './LiveMap';
import cache from '../../lib/cache';
/**
*
@ -292,6 +293,12 @@ export const Handlers: react.FC<HandlersProperties> = (
}
};
const contextMenuHandler = (event: any) => {
console.log(event);
event.preventDefault();
console.log(cache.map({ cacheId: 'points' }));
};
return (
<div
className='handler'
@ -306,6 +313,7 @@ export const Handlers: react.FC<HandlersProperties> = (
onTouchCancel={touchCancelHandler}
onTouchStart={touchStartHandler}
onTouchMove={touchMoveHandler}
onContextMenu={contextMenuHandler}
/>
);
};

View File

@ -49,6 +49,13 @@ const cache = {
k.delete(key);
return value;
},
map: (params: any) => {
const { cacheId } = params;
if (!_allCaches.has(cacheId)) {
return null;
}
return _allCaches.get(cacheId);
},
};
export default cache;