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

Prevent ContextualToolbar of being displayed in specific places #5353

Closed
oskarwrobel opened this issue May 8, 2017 · 3 comments · Fixed by ckeditor/ckeditor5-ui#226
Closed
Labels
package:ui type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone

Comments

@oskarwrobel
Copy link
Contributor

I need to prevent ContextualToolbar of being displayed in some specific situation (when selection range intersects with some specific node). ATM CT displays always when the selection is non-collapsed and there is no way to configure it.

WDYT about adding beforeShow event to the CT plugin. This event will be fired after selection stops changing just before showing the toolbar. Other plugins will be able to listen to this event and modifies CT behavior eg by stopping this event what will prevent CT of being displayed?

@oleq
Copy link
Member

oleq commented May 9, 2017

A similar issue to https://github.com/ckeditor/ckeditor5-ui/issues/223 where the contextual balloon should not overlap the toolbar. IMO there should be a possibility to configure restricted zones (elements, in fact) which DOMRects should be avoided when positioning the balloon.

This, with an addition of an event, because such restricted zones may be dynamic, would be very useful. Just note that such event would need to provide the proposed location of the balloon in the event data to make actual sense.

@oleq oleq changed the title Prevent ContextualToolbar of being displayed Prevent ContextualToolbar of being displayed in specific places May 9, 2017
@oleq
Copy link
Member

oleq commented May 9, 2017

Or maybe I misunderstood: did you mean to analyze the editing view document tree or visual geometry of such tree elements?

@oskarwrobel
Copy link
Contributor Author

In my case, I need to analyze position of selection in model document.

oleq referenced this issue in ckeditor/ckeditor5-ui May 10, 2017
Other: Added the `beforeShow` event to the `ContextualToolbar` plugin. Closes #222.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-ui Oct 9, 2019
@mlewand mlewand added this to the iteration 11 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:feature This issue reports a feature request (an idea for a new functionality or a missing option). package:ui labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:ui type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants