Skip to content
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

Fix the extend-template-render warning #5060

Closed
Reinmar opened this issue Jan 27, 2017 · 4 comments · Fixed by ckeditor/ckeditor5-image#49
Closed

Fix the extend-template-render warning #5060

Reinmar opened this issue Jan 27, 2017 · 4 comments · Fixed by ckeditor/ckeditor5-image#49
Labels
package:image type:task This issue reports a chore (non-production change) and other types of "todos".
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Jan 27, 2017

UI lib introduced a warning about extending already rendered templates and it turns out that the image feature logs a lot of them:

https://travis-ci.org/ckeditor/ckeditor5-image/builds/195804693#L1452

@Reinmar
Copy link
Member Author

Reinmar commented Jan 27, 2017

The problem is here:

		const panel = this._panel = new ImageBalloonPanel( editor );
		const promises = [];
		const toolbar = new ToolbarView();

		// Add CSS class to the panel.
		Template.extend( panel.template, {
			attributes: {
				class: [
					'ck-toolbar__container'
				]
			}
		} );

And... well, ping @oleq for a solution ;>

@oleq
Copy link
Member

oleq commented Jan 27, 2017

The solution is: extend first, render next. And by "render", I mean "access View#element", which renders the element on demand.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 27, 2017

Yeah, but what's accessing #element in this case? It must be ImageBalloonPanel itself.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 27, 2017

ImageBalloonPanelView#constructor:

		// Let the focusTracker know about new focusable UI element.
		editor.ui.focusTracker.add( this.element );

This would need to be moved to init().

Reinmar referenced this issue in ckeditor/ckeditor5-image Feb 9, 2017
Fix: Moved focus tracking setup to `ImageBalloonPanelView#init()` method to prevent too early access to the view element. Closes #42.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-image Oct 9, 2019
@mlewand mlewand added this to the iteration 8 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:task This issue reports a chore (non-production change) and other types of "todos". package:image labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants