1
votes

iOS can not paste when long press but can copy.

I searched like below.

It not works well for me. I used <iframe> as <ion-content> child node. and both the copy and paste action happen on a html page embeded in iframe.

I add nothing to the src/index.html. I post the home.html and home.scssblow.

page-home {

}

.selectable{
    -webkit-user-select: auto;
}

ion-content {
    background: none transparent;
}

iframe {
    background: none transparent;
    -webkit-user-select: auto;
    position: absolute; 
    min-width: 100%; 
    min-height: 100%; 
    z-index: 99;
}
<ion-content scroll="true" overflow-scroll="true" >
  <iframe
      name="mainFrame" id="mainframe"
      src="http://180.168.168.210:8010/mobile/Login.html?"
      class="selectable">
  </iframe>
</ion-content>


And my ionic environment :

cli packages: 
    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:
    Cordova CLI : 7.0.1 

local packages:
    @ionic/app-scripts : 2.0.2
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.5.3

System:
    ios-deploy        : 1.9.1 
    ios-sim           : 5.0.13 
    Node              : v8.4.0
    npm               : 5.3.0 
    OS                : macOS Sierra
    Xcode             : Xcode 8.3.3 Build version 8E3004b 

What should I do? I am confused to set which tag in which file.iframe, ion-content or ion-app in src/index.html?

Sorry to raise my question, but I really need your help!

1

1 Answers

0
votes

You can try this way.

Make sure to add

'overflow-scroll: true' to the ion-content

Then you wrapped the text in a div with class='selectable'

then you made sure to add this to the selectable class.

-webkit-user-select: auto;

here is working example

Note: I haven't tested this on an actual device.

Good luck