Skip to content

Commit 7a65b4a

Browse files
authored
Merge pull request #161 from icflorescu/next
Fix ios touch events, update dev deps
2 parents 32cf9b5 + f7e8ca9 commit 7a65b4a

8 files changed

+313
-357
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
The following is a list of notable changes to the Mantine ContextMenu component.
44
Minor versions that are not listed in the changelog are minor bug fixes and small internal improvements or refactorings.
55

6+
## 7.9.1 (2024-05-09)
7+
8+
- Update dev dependencies to ensure compatibility with Mantine 7.9.1
9+
- Fix iOS touch events
10+
611
## 7.9.0 (2024-05-03)
712

813
- Update dev dependencies to ensure compatibility with Mantine 7.9

app/(home)/HeroImage.module.css

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
transition: filter 0.5s;
88
filter: sepia(0) grayscale(0);
99
cursor: context-menu;
10+
-webkit-user-select: none;
11+
-webkit-touch-callout: none;
1012
}
1113

1214
.sepia {

app/(home)/HomePageTitle.module.css

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
.gradientText {
2121
cursor: context-menu;
22+
-webkit-user-select: none;
2223
}
2324

2425
.mantineDataTableIcon {

components/Picture.module.css

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
border-radius: var(--mantine-radius-sm);
2929
overflow: hidden;
3030
cursor: context-menu;
31+
-webkit-user-select: none;
32+
-webkit-touch-callout: none;
3133
}
3234

3335
.image {

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mantine-contextmenu",
3-
"version": "7.9.0",
3+
"version": "7.9.1",
44
"description": "Craft your applications for productivity and meet your users’ expectations by enhancing your Mantine-based UIs with a desktop-grade, lightweight yet fully-featured, dark-theme aware context-menu component, built by the creator of Mantine DataTable",
55
"keywords": [
66
"ui",
@@ -72,14 +72,14 @@
7272
"format": "prettier --write ."
7373
},
7474
"devDependencies": {
75-
"@ducanh2912/next-pwa": "^10.2.6",
76-
"@mantine/code-highlight": "^7.9.0",
77-
"@mantine/core": "^7.9.0",
78-
"@mantine/hooks": "^7.9.0",
79-
"@mantine/notifications": "^7.9.0",
75+
"@ducanh2912/next-pwa": "^10.2.7",
76+
"@mantine/code-highlight": "^7.9.1",
77+
"@mantine/core": "^7.9.1",
78+
"@mantine/hooks": "^7.9.1",
79+
"@mantine/notifications": "^7.9.1",
8080
"@tabler/icons-react": "^3.3.0",
81-
"@types/lodash": "^4.17.0",
82-
"@types/node": "^20.12.8",
81+
"@types/lodash": "^4.17.1",
82+
"@types/node": "^20.12.11",
8383
"@types/react": "^18.3.1",
8484
"@types/react-dom": "^18.3.0",
8585
"@typescript-eslint/eslint-plugin": "^7.8.0",

package/ContextMenuProvider.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,8 @@ export function ContextMenuProvider({
5656
e.preventDefault();
5757
e.stopPropagation();
5858

59-
const x = "touches" in e
60-
? e.touches[0].clientX
61-
: e.clientX;
62-
const y = "touches" in e
63-
? e.touches[0].clientY
64-
: e.clientY;
59+
const { x, y } =
60+
'touches' in e ? { x: e.touches.item(0).clientX, y: e.touches.item(0).clientY } : { x: e.clientX, y: e.clientY };
6561

6662
setData({
6763
x,

package/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export type ShowContextMenuFunction = (
178178
* Context menu options (overrides provider props).
179179
*/
180180
options?: ContextMenuOptions
181-
) => React.MouseEventHandler;
181+
) => React.MouseEventHandler & React.TouchEventHandler;
182182

183183
/**
184184
* Hide context menu function

0 commit comments

Comments
 (0)