Skip to content

Commit 6d989b7

Browse files
committed
feat: widget@0.1.42: disabling haptics
1 parent fe07f89 commit 6d989b7

4 files changed

Lines changed: 30 additions & 9 deletions

File tree

docs/guide/widget.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,19 @@ You can also specify a custom fetch function with `window.CAP_CUSTOM_FETCH`:
261261
window.CAP_CUSTOM_FETCH = (url, params) => fetch(url, params);
262262
```
263263

264-
You can also set a custom WASM url (for example the Standalone asset server's) with `window.CAP_CUSTOM_WASM_URL` or set a nonce for the CSS with `window.CAP_CSS_NONCE`
264+
You can also set a custom WASM url (for example the Standalone asset server's) with `window.CAP_CUSTOM_WASM_URL` or set a nonce for the CSS with `window.CAP_CSS_NONCE`.
265+
266+
To disable haptic feedback (vibrations on mobile devices), set `window.CAP_DISABLE_HAPTICS = true` globally or add the `data-cap-disable-haptics` attribute to individual widgets:
267+
268+
```js
269+
window.CAP_DISABLE_HAPTICS = true;
270+
```
271+
272+
```html
273+
<cap-widget data-cap-disable-haptics data-cap-api-endpoint="..."></cap-widget>
274+
```
275+
276+
Haptic feedback is automatically disabled in [programmatic mode](./programmatic) since there is no visible widget for the user to interact with
265277

266278
### Attributes
267279

@@ -271,6 +283,7 @@ You can also set a custom WASM url (for example the Standalone asset server's) w
271283
| `data-cap-worker-count` | Number of solver workers (defaults to `navigator.hardwareConcurrency \|\| 8`) |
272284
| `data-cap-hidden-field-name` | Name of the hidden token input in a `<form>` (default: `cap-token`) |
273285
| `data-cap-troubleshooting-url` | Custom URL for the "Troubleshooting" link shown when a user is blocked |
286+
| `data-cap-disable-haptics` | Disable haptic feedback (vibrations) on this widget |
274287

275288
#### i18n
276289

0 commit comments

Comments
 (0)