@star-insure/sdk 3.2.11 → 3.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@star-insure/sdk",
3
3
  "description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
4
4
  "author": "alexclark_nz",
5
- "version": "3.2.11",
5
+ "version": "3.2.12",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -30,7 +30,11 @@ export default function Action({ title, href, as = 'Link', target = '_self', typ
30
30
  // Check if Ctrl (Windows) or Cmd (Mac) key is pressed
31
31
  const isCtrlOrCmdPressed = (e.ctrlKey || e.metaKey);
32
32
 
33
- if (e.key === shortcutKey && isCtrlOrCmdPressed) {
33
+ // Check if the focus is on an input element or inside a form
34
+ const isInInput = e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement;
35
+ const isInForm = (e.target instanceof Element && e.target.closest('form'));
36
+
37
+ if (isCtrlOrCmdPressed && !isInInput && !isInForm && e.key === shortcutKey) {
34
38
  e.preventDefault();
35
39
  runAction();
36
40
  }