我在手机上使用应用程序时遇到问题。
它在笔记本电脑浏览器上运行得很好。当我尝试使用手机时,我无法编辑文本区域。
流程如下: 打开模态 无法访问文本区域
$scope.testMember = function (item) {
$modalStack.dismissAll('cancel');
$modal.open({
templateUrl: './testmail.html',
controller: 'TestMailCtrl',
resolve: {
emailRead: function() {
return item;
}
}
});
<div class="col-lg-9 col-sm-4 follow-info">
<label class="control-label">Message:<br/></label>
<textarea name="bodyText" id="bodyText" class="form-control" ng-maxlength="2000" cols="400" rows="10" ng-model="testBodyText"></textarea>
</div>
这在我的笔记本电脑上运行良好。在我的手机上不起作用。
菲尔
最佳答案
我正在自己的项目中解决这个问题,方法是阻止 touchend 事件传播到模态表单,如下所示:
<div class="modal-body" stop-event="touchend">
使用这样的指令:
.directive('stopEvent', function () {
return {
restrict: 'A',
link: function (scope, element, attr) {
element.on(attr.stopEvent, function (e) {
e.stopPropagation();
});
}
};
});
关于javascript - AngularJS网页版工作移动文本区域无法编辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44785385/