angular-ui / ui-ace

This directive allows you to add ACE editor elements.
http://angular-ui.github.io/ui-ace
MIT License
578 stars 172 forks source link

Editor doesn't render if initially hidden #18

Closed nkerkin closed 9 years ago

nkerkin commented 10 years ago

Check out this plunker http://plnkr.co/edit/zNdlc3jts4a8w3kS08uw?p=preview

The second editor doesn't render until you make a modification.

jugglingcats commented 10 years ago

Am also seeing this issue.

harobed commented 10 years ago

+1

ricochet1k commented 10 years ago

Looks like the same issue mentioned here: https://groups.google.com/forum/#!topic/ace-discuss/9oSvtlMuEqk

ricochet1k commented 10 years ago

This might not be the best solution, but this does fix it: http://plnkr.co/edit/AoHjz4IXWcJXn6eLAFBb?p=preview

    scope.$watch(function() {
      return [elm[0].offsetWidth, elm[0].offsetHeight];
    }, function() {
      acee.resize();
      acee.renderer.updateFull();
    }, true);
douglasduteil commented 10 years ago

@ricochet1k That's cool! Can you make a PR with it ?

RaphaelRheault commented 9 years ago

I found a similar problem when using ui-ace with ng-show in a ng-repeat. It's probably related to this bug. http://plnkr.co/edit/7BAtJ8vq0zP5rqbmcti6?p=preview

RaphaelRheault commented 9 years ago

Found a solution : use ng-if instead of ng-show. Everything works fine that way.

douglasduteil commented 9 years ago

Alright It might be because Ace has to be refreshed when using ng-show/hide with the resize function