ui-tinymce icon indicating copy to clipboard operation
ui-tinymce copied to clipboard

Error destroying when closing dialog or navigating in Firefox (47.0.1)

Open johnwpowell opened this issue 9 years ago • 3 comments

To reproduce Put the editor on a dialog Close the dialog without editing any of the text An error occurs in in the tinyInstance.remove() calls Put the editor on a view Navigate away from the view without making any changes An error occurs in the tinyInstance.remove() calls

The code in the directive is: scope.$on('$destroy', function () { ensureInstance();

              if (tinyInstance) {
                  **tinyInstance.remove();** /// <-- This call errors
                  tinyInstance = null;
              }
          });

          function ensureInstance() {
              if (!tinyInstance) {
                  tinyInstance = tinymce.get(attrs.id);
              }
          }

Stack trace:

.serialize@http://localhost:43548/Scripts/vendor/tinymce.min.js:5:19133 A.prototype.getContent@http://localhost:43548/Scripts/vendor/tinymce.min.js:11:19898 A.prototype.save@http://localhost:43548/Scripts/vendor/tinymce.min.js:11:18533 A.prototype.remove@http://localhost:43548/Scripts/vendor/tinymce.min.js:11:21799 .link/<@http://localhost:43548/Scripts/angular-ui/tinymce.js:194:23 $RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost:43548/Scripts/vendor/angular.js:17767:15 $RootScopeProvider/this.$get</Scope.prototype.$destroy@http://localhost:43548/Scripts/vendor/angular.js:17385:9 afterAnimating@http://localhost:43548/Scripts/angular-ui/ui-bootstrap-tpls.js:3826:11 processQueue@http://localhost:43548/Scripts/vendor/angular.js:16170:28 scheduleProcessQueue/<@http://localhost:43548/Scripts/vendor/angular.js:16186:27 $RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:43548/Scripts/vendor/angular.js:17444:16 $RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:43548/Scripts/vendor/angular.js:17257:15 $RootScopeProvider/this.$get</Scope.prototype.$evalAsync/<@http://localhost:43548/Scripts/vendor/angular.js:17483:15 completeOutstandingRequest@http://localhost:43548/Scripts/vendor/angular.js:5955:7 Browser/self.defer/timeoutId<@http://localhost:43548/Scripts/vendor/angular.js:6234:7

johnwpowell avatar Jul 22 '16 18:07 johnwpowell

I am getting the same error under the same circumstances as @johnwpowell, however I only get this exception thrown w/ FireFox 47.x

I believe this thread is related. [https://github.com/tinymce/tinymce/issues/794]

calbear47 avatar Jul 28 '16 17:07 calbear47

Could you please post a plunker reproducing the issue. From @calbear47's comment it might be an issue with TinyMCE core, and not this library. I could take a closer look if you put up a plunker.

deeg avatar Sep 15 '16 14:09 deeg

I had the same issue and updating tinymce and ui-tinymce with the latest versions resolved everything.

piRstone avatar Aug 10 '17 09:08 piRstone