Can't edit the input fields [edit: Video]

Hi,
I can’t edit my inputs…text, textarea, whatever…

If the input has a value and I press backspace for a few seconds(the shift key turns on like if I had at the start of input), only then the field is cleared and I can edit.

I’ll make a video for you to have a better idea.

Thanks

Edit:
Follow the video: https://www.youtube.com/watch?v=gotRt_6uAfY

So from the looks of it, you have ios6?

What version of ionic do you have? Whats your markup look like? Can you provide a codepen or plnkr demo?

Hi,
I’m using this:

<label class="item item-input">
    <span  class="input-label">Title</span >
<input type="text" ng-model="description "/>		        

and the nightly - 1.0.0-beta.9-nightly-276

Follow the codpen test http://codepen.io/fabioc/full/fywgK/

In Safari I have the same problem.

Thanks

Is this issue on ios 6?

No.
iOS 7.1.2

I’m test on iOS simulator(Safari) and same problem.

Hmm, odd I never had this issue before. Are you getting any errors in the console? Can you provide a codepen example for that page so I can test it out on my end?

No errors.

My page is exactly this that is in codepen(http://codepen.io/fabioc/full/fywgK/).
With this codepen example I can´t edit input too, I get the same error.

In the video I only put a button save on the right and some text in first input field to test because it was
not working

Thanks for your Help

Really odd, I wasn’t having any issues. Curious though, if you tested on ios 7, why were you getting an ios 6 style keyboard?

I’m running inside HP Anywhere…so propably it is your configuration.

Because this I create a codepen to text external HP Anywhere…and I had the same problem testing on my device and in iOS simulator.

Hmm, well I tested it with just cordova

Since HP Anywhere uses iframes, it could be causing issues with inputs and events that ionic is listening for.

But why in Safari I get this problem?
You test the codepen in safari and its Ok?

Yeah tried it in mobile safari and it all works fine. All I did was copy the contents of your codepen to a blank starter project

OMG…
look
https://www.youtube.com/watch?v=wgfiq6c0tSA

Codepen uses iframe too…

HPA uses cordova behind, so u can use all basics plugins and others thats
coming together.
I have to use window.parent.cordova…

Whats happening behind? Ionic duplicate my field?

Yes, we do duplicate inputs, There were some situations where inputs would causing scroll issues.

Hmm, so the best thing I could suggest is to not use HPA, since ionic isn’t adapted for it

hmm…i will try fix later

I have to use HPA because is a requirement…

Thanks for help

Requirements…ah I know what you mean.

Yeah I wish I could be of more help.

Best of luck

Only an update:

In the method “tapHandleFocus” in ionic.js I put before to set a focus to input element:

if(window.parent) {      
  window.parent.document.getElementById('iframe').contentWindow.focus();
}
ele.focus && ele.focus();

And now works fine.

Thanks

I’m experiencing the exact same issue and specifically inside of the Salesforce1 App and only on iOS (7+). @fabioc, this fix doesn’t seem to work for me - where exactly in the method are you putting it? I have it here…

function tapHandleFocus(ele) {
  tapTouchFocusedInput = null;

  var triggerFocusIn = false;

  if(ele.tagName == 'SELECT') {
    // trick to force Android options to show up
    triggerMouseEvent('mousedown', ele, 0, 0);
    if(window.parent) {      
      window.parent.document.getElementById('vfFrameId').contentWindow.focus();
    }
    ele.focus && ele.focus();
    triggerFocusIn = true;

  } else if(tapActiveElement() === ele) {
    // already is the active element and has focus
    triggerFocusIn = true;

  } else if( (/^(input|textarea)$/i).test(ele.tagName) || ele.isContentEditable ) {
    triggerFocusIn = true;
    if(window.parent) {      
      window.parent.document.getElementById('vfFrameId').contentWindow.focus();
    }
    ele.focus && ele.focus();
    ele.value = ele.value;
    if( tapEnabledTouchEvents ) {
      tapTouchFocusedInput = ele;
    }

  } else {
    tapFocusOutActive();
  }

  if(triggerFocusIn) {
    tapActiveElement(ele);
    ionic.trigger('ionic.focusin', {
      target: ele
    }, true);
  }
}

I was able to get the input fields working using just window.focus() at the top of the tapHandleFocus method… However text areas seem to still be broken. I’ve kicked off a discussion on StackOverflow

Is this something the Ionic team will address? Salesforce uses ionic in many of their example apps as things that can be built using visualforce, but having text inputs be broken out of the box on iOS is kind of a non-starter for many I would imagine.

Let me know if there’s anything I can provide to help solve this problem.

I am experiencing the same problem, is there any update/fix for this?

Edit: OK i figured the problem appears when using placeholder… too bad, i very much liked placeholder, its better then label on screens with limited size.

1 Like