Search code examples
javascriptangularjsangularjs-scopemobile-safari

iPhones copy paste menu gets closed when updating view


I have an order page with a countdown which tells the user how much time he has left to complete his order. We spotted that when the user wants to paste something into an input field and opens this context menu for it, the menu will close each time the timer updates.

Copy paste menu on iOS

JS

var app = angular.module("EvTest", []);
app.controller("TestController", function($scope, $interval) {
  $scope.counter = 1;
  $interval(function() {
    $scope.counter++;
  }, 1000);
});

HTML

<div ng-controller="TestController">
  <input type="text" style="width:100%;" placeholder="Test me!" />
  {{counter}}
</div>

Fiddle: http://jsfiddle.net/bojarhwt/

Is there any way around this?


Solution

  • The problem is solved with updating to iOS 8.3. Apparently it was a bug in Safari.