https://github.com/Cap-go/capacitor-textinteraction
Capacitor plugin to toggle text interaction in iOS apps
https://github.com/Cap-go/capacitor-textinteraction
capacitor ionic ios plugin
Last synced: about 1 month ago
JSON representation
Capacitor plugin to toggle text interaction in iOS apps
- Host: GitHub
- URL: https://github.com/Cap-go/capacitor-textinteraction
- Owner: Cap-go
- License: mpl-2.0
- Created: 2025-09-24T09:44:22.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-28T17:47:56.000Z (about 1 month ago)
- Last Synced: 2026-01-29T08:20:31.724Z (about 1 month ago)
- Topics: capacitor, ionic, ios, plugin
- Language: Swift
- Homepage: https://capgo.app
- Size: 564 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-capacitor - Text Interaction - Toggle text interaction in Capacitor based iOS apps. ([Capgo plugins](https://capgo.app/) / UI & Display)
README
# @capgo/capacitor-textinteraction

Toggle text interaction in Capacitor based iOS apps.
## Documentation
The most complete doc is available here: https://capgo.app/docs/plugins/textinteraction/
## Compatibility
| Plugin version | Capacitor compatibility | Maintained |
| -------------- | ----------------------- | ---------- |
| v8.\*.\* | v8.\*.\* | ✅ |
| v7.\*.\* | v7.\*.\* | On demand |
| v6.\*.\* | v6.\*.\* | ❌ |
| v5.\*.\* | v5.\*.\* | ❌ |
> **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
## Install
```bash
npm install @capgo/capacitor-textinteraction
npx cap sync
```
## Usage
```ts
import { TextInteraction } from '@capgo/capacitor-textinteraction';
// Disable the iOS magnifier lens while the WebView is visible
await TextInteraction.toggle({ enabled: false });
// Remember to re-enable before presenting any text inputs
await TextInteraction.toggle({ enabled: true });
```
## API
* [`toggle(...)`](#toggle)
* [`getPluginVersion()`](#getpluginversion)
* [Interfaces](#interfaces)
### toggle(...)
```typescript
toggle(options: TextInteractionOptions) => Promise
```
Toggle text interaction (selection) on the Capacitor WebView.
⚠️ Disabling text interaction prevents all text input controls from working while disabled.
Use it sparingly and re-enable when text entry is required.
iOS only.
| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| **`options`** | TextInteractionOptions |
**Returns:** Promise<TextInteractionResult>
--------------------
### getPluginVersion()
```typescript
getPluginVersion() => Promise<{ version: string; }>
```
Get the native Capacitor plugin version
**Returns:** Promise<{ version: string; }>
--------------------
### Interfaces
#### TextInteractionResult
| Prop | Type | Description |
| ------------- | -------------------- | ------------------------------------------------------------------------------------------------ |
| **`success`** | boolean | `true` when the platform supports toggling text interaction (iOS >= 14.5), otherwise `false`. |
| Method | Signature | Description |
| -------------------- | -------------------------------------------- | --------------------------------------- |
| **getPluginVersion** | () => Promise<{ version: string; }> | Get the native Capacitor plugin version |
#### TextInteractionOptions
| Prop | Type | Description |
| ------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **`enabled`** | boolean | Whether text interaction should be enabled or disabled. Disabling hides the magnifier lens reintroduced with iOS 15. |
### Credits
This plugin was inspired by the work of https://github.com/astrocreep/capacitor-plugins/tree/main/packages/textinteraction