-
-
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
Make existing dropdowns initialize their panel content on first open #12890
Comments
My 2c regarding ck/12682-performance-reference...ck/12682-performance-lazy-init#diff-5848ac0a8fcb5189cbf784a5a29e686ce98406901539650cee81f0a473df2c03R77-R81:
can be simplified into
because every dropdown is closed when created
|
This case is not so simple, the
|
Looks like it comes down to ckeditor5/packages/ckeditor5-mention/src/mentionui.js Lines 133 to 138 in 30acb8f
We could probably make |
The "minor" breaking changes for release v36.0.0 state that you have to "make sure that you access the dropdown panel/toolbar items after the dropdown is open/the toolbar is visible. Well, how exactly can this be done? It would be nice to have some examples in the update guide for v36.x. Custom plugins of our build need to listen to the submit-event of LinkUI.formView or manipulate the listView of dropdown buttons, for example. And this should only happen once, I obviously don't want to bind events everytime a view is opened or manipulate a listView everytime it is shown. |
@niegowski I think we had somewhere an example but I'm not sure. Does it ring any bells on your side? |
@Witoso maybe you are looking for this? #4836 (comment) |
Thanks, listening to change:visibleView of ContextualBalloon works great. I figured this would be the solution, just wasn't sure if this is best practice in this scenario. Now, this seems to work only for toolbars that are triggered by actions inside the editable, i.e. clicking on links or images. When clicking a button in the main editor toolbar that opens a dropdown (like the headings dropdown from the HeadingUI), change:visibleView of ContextualBalloon is not triggered. I need to now when the buttons of theses dropdowns are initially rendered/visible. What would be the correct emitter and event in this case? |
Maybe this will help with dropdowns: ckeditor5/packages/ckeditor5-ui/src/dropdown/utils.ts Lines 195 to 199 in 2cffea9
I tested it in some manual test where the first toolbar item is a headings dropdown: editor.ui.view.toolbar.items.first.once( 'change:isOpen', ( { source } ) => console.log( source.listView ) ) So more generic it would be: dropdownView.once( 'change:isOpen', ( { source } ) => console.log( source.listView ) ) |
Thanks, works great, too! Appreciate the quick help. |
Part of #12592. Research in #12682.
PoC in
ck/12682-performance-reference...ck/12682-performance-lazy-init
.Scope:
The text was updated successfully, but these errors were encountered: