Skip to content

Commit 9a57cd8

Browse files
authored
Merge pull request #51 from aeagle/feature/mouse-touch-events
Added pass through of more mouse/touch events to space element
2 parents e08375a + 2d8f0f1 commit 9a57cd8

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

react-spaces/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-spaces",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"main": "dist/index.js",
55
"module": "dist/es/index.js",
66
"types": "dist/index.d.ts",

react-spaces/src/Globals/Types.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ export interface IPublicProps {
4747
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void,
4848
onMouseDown?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void,
4949
onMouseEnter?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void,
50-
onMouseLeave?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void
50+
onMouseLeave?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void,
51+
onMouseMove?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void,
52+
onTouchStart?: (event: React.TouchEvent<HTMLElement>) => void,
53+
onTouchMove?: (event: React.TouchEvent<HTMLElement>) => void,
54+
onTouchEnd?: (event: React.TouchEvent<HTMLElement>) => void
5155
}
5256

5357
export const publicProps = {
@@ -62,7 +66,11 @@ export const publicProps = {
6266
onClick: PropTypes.func,
6367
onMouseDown: PropTypes.func,
6468
onMouseEnter: PropTypes.func,
65-
onMouseLeave: PropTypes.func
69+
onMouseLeave: PropTypes.func,
70+
onMouseMove: PropTypes.func,
71+
onTouchStart: PropTypes.func,
72+
onTouchMove: PropTypes.func,
73+
onTouchEnd: PropTypes.func
6674
}
6775

6876
export interface IPrivateProps {

react-spaces/src/Space.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@ export const SpaceInternal : React.FC<AllProps> = React.memo((props) => {
244244
onClick: props.onClick,
245245
onMouseDown: props.onMouseDown,
246246
onMouseEnter: props.onMouseEnter,
247-
onMouseLeave: props.onMouseLeave
247+
onMouseLeave: props.onMouseLeave,
248+
onMouseMove: props.onMouseMove,
249+
onTouchStart: props.onTouchStart,
250+
onTouchMove: props.onTouchMove,
251+
onTouchEnd: props.onTouchEnd
248252
},
249253
<>
250254
{ !USE_INLINESTYLES && <HeadStyles spaces={currentContext.children} /> }
@@ -270,7 +274,11 @@ export const SpaceInternal : React.FC<AllProps> = React.memo((props) => {
270274
onClick: props.onClick,
271275
onMouseDown: props.onMouseDown,
272276
onMouseEnter: props.onMouseEnter,
273-
onMouseLeave: props.onMouseLeave
277+
onMouseLeave: props.onMouseLeave,
278+
onMouseMove: props.onMouseMove,
279+
onTouchStart: props.onTouchStart,
280+
onTouchMove: props.onTouchMove,
281+
onTouchEnd: props.onTouchEnd
274282
},
275283
<>
276284
{ !USE_INLINESTYLES && <HeadStyles spaces={currentContext.children} /> }

0 commit comments

Comments
 (0)