-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding toolbar to widget fails #4608
Comments
@jodator, can you take a look at this? |
Ping 🔔 |
Sorry for that - if might loos track of this. So there are two issues:
Anyway the scenario in 2 should be handled better. The |
Thanks, I'll give these updates a try. |
Fix: A proper `DomConverter` method should be used to map a view to DOM when getting balloon position data. Closes #87.
I'm attempting to add a toolbar to my formula widget with this code in my plugin class:
I see the getRelatedElement function getting called and successfully returning an element when my formula widget is selected.
However, I get the following stack trace:
domconverter.js:254 Uncaught TypeError: Cannot read property 'createElement' of undefined at DomConverter.viewToDom (domconverter.js:254) at getBalloonPositionData (widgettoolbarrepository.js:333) at WidgetToolbarRepository._showToolbar (widgettoolbarrepository.js:283) at WidgetToolbarRepository._updateToolbarsVisibility (widgettoolbarrepository.js:244) at ClassicEditorUI.<anonymous> (widgettoolbarrepository.js:109) at ClassicEditorUI.fire (emittermixin.js:242) at ClassicEditorUI.update (editorui.js:103) at Document.<anonymous> (editorui.js:73) at Document.fire (emittermixin.js:242) at View.<anonymous> (view.js:201)
I've traced the issue to line 246 of ckeditor5-widget/src/widgettoolbarrepository.js
target: editingView.domConverter.viewToDom( relatedElement )
This function call only passes in one parameter, but viewToDom expects two:
viewToDom(viewNode, domDocument)
When viewToDom later calls:
domElement = domDocument.createElement(viewNode.name);
It throws the error "Cannot read property 'createElement' of undefined"
And no toolbar appears.
The text was updated successfully, but these errors were encountered: