1.2.0 • Published 12 months ago

@astrocreep/capacitor-textinteraction v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@astrocreep/capacitor-textinteraction

Toggle text interaction in Capacitor based iOS apps.

Background: Apple reintroduced the magnifier lens with iOS 15. There are two different ways how this function is triggered. Either by longpressing on a text element or by double tap and hold. You can disable the longpress version in CSS via -webkit-user-select: none;, but this won't work for the double tap and hold. As I'm using Capacitor for games, the lens is the last thing I want to pop up while playing the game šŸ˜‡

Install

npm install @astrocreep/capacitor-textinteraction
npx cap sync

API

toggle(...)

toggle(options: TextInteractionOptions) => Promise<TextInteractionResult>

Toggle text interaction (selection) on the Capacitor WebView.

āš ļø As long as you disable text interaction, you won't be able to use any input fields in the WebView. Either disable while text input is active or use native text input overlays.

ParamType
optionsTextInteractionOptions

Returns: Promise<TextInteractionResult>

Since: 1.0.0


Interfaces

TextInteractionResult

PropTypeDescriptionSince
successbooleantrue if supported (>= iOS 14.5), false if not1.0.0

TextInteractionOptions

PropTypeDescriptionSince
enabledbooleanWhether text interaction should be enabled or disabled. Disabling suppresses the magnifier lens that Apple reintroduced with iOS 15. iOS only1.0.0
1.2.0

12 months ago

1.1.0

12 months ago