Skip to content

Cap-go/capacitor-textinteraction

@capgo/capacitor-textinteraction

Capgo - Instant updates for capacitor

Toggle text interaction in Capacitor based iOS apps.

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/textinteraction/

Install

npm install @capgo/capacitor-textinteraction
npx cap sync

Usage

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(options: TextInteractionOptions) => Promise<TextInteractionResult>

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()

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

About

Capacitor plugin to toggle text interaction in iOS apps

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •