Page MenuHomePhabricator

"TypeError: Cannot read property 'getRoot' of undefined" for Structured discussion mention in VE
Closed, DuplicatePublic

Description

  1. On a Structured discussion page switch to VE mode
  2. Click on 'Mention a user' icon and enter a user name.
  3. Click 'Insert' - the following error will be displayed in the Console.

Note:

  • the same error is displayed in betalabs
  • mentioning when in 'Source editing' does not produce the error
  • the functionality of mention does not seem to be affected
Uncaught TypeError: Cannot read property 'getRoot' of undefined

lengthChange = this.$element.length !== $newElements.length;
                this.$element.first().replaceWith($newElements);
                this.$element.remove();
                this.$element = $newElements;
                if (lengthChange) {
                    setTimeout(function() {
                        if (node.getRoot() && node.getRoot().getSurface()) {
                            node.getRoot().getSurface().showModelSelection();
                        }