diff --git a/package-lock.json b/package-lock.json
index 1cfdb4b..bfa8b48 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,20 +8,20 @@
"name": "capacitor-testapp",
"version": "0.0.1",
"dependencies": {
- "@capacitor/action-sheet": "^8.0.0",
- "@capacitor/android": "^8.0.0",
+ "@capacitor/action-sheet": "^8.1.1",
+ "@capacitor/android": "^8.2.0",
"@capacitor/app": "^8.0.0",
"@capacitor/app-launcher": "^8.0.0",
"@capacitor/browser": "^8.0.0",
"@capacitor/camera": "^8.0.0",
"@capacitor/clipboard": "^8.0.0",
- "@capacitor/core": "^8.0.0",
+ "@capacitor/core": "^8.2.0",
"@capacitor/device": "^8.0.0",
"@capacitor/dialog": "^8.0.0",
"@capacitor/filesystem": "^8.0.0",
"@capacitor/geolocation": "^8.0.0",
"@capacitor/haptics": "^8.0.0",
- "@capacitor/ios": "^8.0.0",
+ "@capacitor/ios": "^8.2.0",
"@capacitor/keyboard": "^8.0.0",
"@capacitor/local-notifications": "^8.0.0",
"@capacitor/motion": "^8.0.0",
@@ -35,7 +35,7 @@
"@capacitor/status-bar": "^8.0.0",
"@capacitor/text-zoom": "^8.0.0",
"@capacitor/toast": "^8.0.0",
- "@ionic/pwa-elements": "^3.1.1",
+ "@ionic/pwa-elements": "^3.4.0",
"@ionic/react": "^7.0.0",
"@ionic/react-router": "^7.0.0",
"@types/jest": "^26.0.20",
@@ -51,7 +51,7 @@
"react-router-dom": "^5.3.4"
},
"devDependencies": {
- "@capacitor/cli": "^8.0.0",
+ "@capacitor/cli": "^8.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
@@ -5593,43 +5593,14 @@
"node": ">=10.13.0"
}
},
- "node_modules/glob/node_modules/balanced-match": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
- "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "18 || 20 || >=22"
- }
- },
- "node_modules/glob/node_modules/brace-expansion": {
- "version": "5.0.5",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
- "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "balanced-match": "^4.0.2"
- },
- "engines": {
- "node": "18 || 20 || >=22"
- }
- },
"node_modules/glob/node_modules/minimatch": {
"version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
"dev": true,
- "license": "BlueOak-1.0.0",
- "dependencies": {
- "brace-expansion": "^5.0.2"
- },
+ "license": "MIT",
"engines": {
- "node": "18 || 20 || >=22"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
+ "node": "20 || >=22"
}
},
"node_modules/globals": {
diff --git a/package.json b/package.json
index c01319f..c187eff 100644
--- a/package.json
+++ b/package.json
@@ -25,20 +25,20 @@
]
},
"dependencies": {
- "@capacitor/action-sheet": "^8.0.0",
- "@capacitor/android": "^8.0.0",
+ "@capacitor/action-sheet": "^8.1.1",
+ "@capacitor/android": "^8.2.0",
"@capacitor/app": "^8.0.0",
"@capacitor/app-launcher": "^8.0.0",
"@capacitor/browser": "^8.0.0",
"@capacitor/camera": "^8.0.0",
"@capacitor/clipboard": "^8.0.0",
- "@capacitor/core": "^8.0.0",
+ "@capacitor/core": "^8.2.0",
"@capacitor/device": "^8.0.0",
"@capacitor/dialog": "^8.0.0",
"@capacitor/filesystem": "^8.0.0",
"@capacitor/geolocation": "^8.0.0",
"@capacitor/haptics": "^8.0.0",
- "@capacitor/ios": "^8.0.0",
+ "@capacitor/ios": "^8.2.0",
"@capacitor/keyboard": "^8.0.0",
"@capacitor/local-notifications": "^8.0.0",
"@capacitor/motion": "^8.0.0",
@@ -52,7 +52,7 @@
"@capacitor/status-bar": "^8.0.0",
"@capacitor/text-zoom": "^8.0.0",
"@capacitor/toast": "^8.0.0",
- "@ionic/pwa-elements": "^3.1.1",
+ "@ionic/pwa-elements": "^3.4.0",
"@ionic/react": "^7.0.0",
"@ionic/react-router": "^7.0.0",
"@types/jest": "^26.0.20",
@@ -68,7 +68,7 @@
"react-router-dom": "^5.3.4"
},
"devDependencies": {
- "@capacitor/cli": "^8.0.0",
+ "@capacitor/cli": "^8.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
diff --git a/src/pages/ActionSheet.tsx b/src/pages/ActionSheet.tsx
index dca3815..f12fa45 100644
--- a/src/pages/ActionSheet.tsx
+++ b/src/pages/ActionSheet.tsx
@@ -7,30 +7,54 @@ import {
IonMenuButton,
IonTitle,
IonToolbar,
+ IonToggle,
+ IonItem,
+ IonLabel,
} from '@ionic/react';
-import React from 'react';
+import React, { useState } from 'react';
import { ActionSheet, ActionSheetButtonStyle } from '@capacitor/action-sheet';
const ActionSheetPage: React.FC = () => {
+ const [cancelable, setCancelable] = useState(true);
+
const showActions = async () => {
- let promptRet = await ActionSheet.showActions({
+ const result = await ActionSheet.showActions({
title: 'Photo Options',
message: 'Select an option to perform',
options: [
- {
- title: 'Upload',
- },
- {
- title: 'Share',
- },
+ { title: 'Upload' },
+ { title: 'Share' },
{
title: 'Remove',
style: ActionSheetButtonStyle.Destructive,
},
],
+ cancelable: cancelable,
});
- console.log('You selected', promptRet);
+
+ console.log('Normal sheet:', result);
+ alert('Normal sheet: ' + JSON.stringify(result));
};
+
+ const showActionsWithCancel = async () => {
+ const result = await ActionSheet.showActions({
+ title: 'Photo Options',
+ message: 'Select an option to perform',
+ options: [
+ { title: 'Upload' },
+ { title: 'Share' },
+ {
+ title: 'Cancel',
+ style: ActionSheetButtonStyle.Cancel,
+ },
+ ],
+ cancelable: cancelable,
+ });
+
+ console.log('Cancel sheet:', result);
+ alert('Cancel sheet: ' + JSON.stringify(result));
+ };
+
return (