Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Model refresh from resize event doesn't works #76

Closed
Mastanka opened this issue Dec 6, 2015 · 2 comments
Closed

Model refresh from resize event doesn't works #76

Mastanka opened this issue Dec 6, 2015 · 2 comments

Comments

@Mastanka
Copy link

Mastanka commented Dec 6, 2015

I'm not shure if it's cauesed by the same bug as #54 , but I found that refresh of model wont be reflected to textarea if you'll do it in resize event
http://plnkr.co/edit/wKhuQqq7hJs53d57zx1X?p=preview

For instance, when you want to use elastic TextArea as input for message system and you want to send message -> clear content when user press enter. I was able to distinct resize event when it's caused by pressing enter, but I wasn't able to reproduce it in plunker.. :-/

    $scope.$on('elastic:resize', function (event, element, oldHeight, newHeight) {
        if (element.context.innerHTML.substr(element.context.innerText.length) === "\n") {
            $scope.comment = ""; //Wont refresh immediately, only after you click
        }
    });
@farooqu
Copy link

farooqu commented Nov 8, 2016

Angular doesn't digest on events. http://stackoverflow.com/questions/22414017/angularjs-why-am-i-needing-scope-apply-within-scope-on.
Forcing an digest via $apply, $digest, or using a $timeout should resolve this issue.

@monospaced
Copy link
Owner

Archiving repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants