Issue: dynamically set focus to a textarea won't make it scrollable


#1

In our app, we have a post page which includes a textarea. And it use the following directive:
.directive(‘focusMe’, function ($timeout) {
return {
link: function (scope, element, attrs) {
$timeout(function () {
element[0].focus();
}, 150);
}
};
})
which will dynamically focus upon opening the page. But the textarea isn’t scrollable immediately unless you tap it and then scroll.
To summary, after the page open:

  1. if you scroll the textarea, you can’t;
  2. if you tap the textarea first(which also trigger the focus) and then scroll, you can.

Any ideas how to fix this? Thanks in advance.