The mount callback in TooltipView is invoked before it is attached to the DOM.

Is it intentional to attach the view container to ‘parent’ at the last line in the EditorView constructor?

This ensures that all TooltipViews have a chance to be ‘mounted’ before being attached to the DOM tree. At this moment, the attributes in view.dom are null in the mount callback, even though there are several ways to detect if an element is truly attached to the DOM.

Ah, you mean when tooltips are present right on editor initialization? Yeah, I guess it’s better to attach the editor earlier. This patch makes that change.

1 Like