So I've looked around at doing this as I need to get around an iOS bug, and none of my simulated clicks seem to work. I'm trying to manually focus on a textarea element but to do that I need to manually simulate a click on said textarea element. So here's what I've tried:
$('#text-input')[0].click();
$('#text-input').click();
$('#text-input').trigger('click');
$('#text-input').focus();
and
$('#text-input').on('click', function {
$(this).focus();
});
$('#text-input').trigger('click');
$('#text-input').on('touchstart', function {
$(this).focus();
});
$('#text-input').trigger('touchstart');
HTML:
<textarea id="comment-input" class="comment-input" rows="1" maxlength="{{maxTextLength}}" ng-model="newMessage.content" placeholder="{{ messagePlaceholder }}" />
Any thoughts on why this isn't working?