[FEATURE REQUESTS] - block's toolbar at bottom option.
Question
hi @artf
How are you? I'm facing a small issue on GrapesJS and I would like to hear your thoughts about the best approach here. My issue is: When I have a small block, like a Link, placed at the top left corner of the Canvas, the toolbar totally covers the block and I can't see it. I would have to unselect that block to see it again. What do you think as the best solution to this problem? I was thinking about to create a new option for GrapesJS to let the user select to display the toolbar at the bottom or the top of the block. This fixes my bug but introduces another, that's when the block is at the bottom of the canvas I would have to display the toolbar at the top this time. What do you think? Is there any chance this new option be added to GrapesJS code? Do you have a better approach? Please let me know!
Answers (3)
Hi @arthuralmeidap I think the #1434 talks about the same problem. Honestly, I've already solved, basically the same issue, with the RTE toolbar, so I guess, if you have time, you could copy/share the same functionality for the Component's toolbar.
I'll place below a few hints about the current implementation in RTE: Currently, if you activate the RTE, its toolbar will be placed at the top. Once the top canvas edge is reached, the toolbar is placed below the component. Reproducible on the demo Implemented here: https://github.com/artf/grapesjs/blob/8af686cb7fa66863c04b786ed1aa704e5406252e/src/rich_text_editor/index.js#L234-L253
As you might see I pass also rteToolbarPosUpdate event to the getTargetToElementDim method, which allows to customize the position extarnally (example usage in the CKEditor plugin: https://github.com/artf/grapesjs-plugin-ckeditor/blob/7c227de0b187da8cb7b1e22b3da34837659977d1/src/index.js#L110-L132)
The only problem with this implementetion is when you have to deal with big component (eg. section), not that common in text components. For instance, when you reach the top canvas edge but the bottom of the component it's still below the canvas. So, in that case, it might be good to leave the current positioning: https://github.com/artf/grapesjs/blob/8af686cb7fa66863c04b786ed1aa704e5406252e/src/commands/view/SelectComponent.js#L529-L544
@artf I created the PR #1730 for this. Take a look when possible! Thanks for your help as always!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #827
[QUESTION] Change location of command panel
Amazing library, thank you!! I have two questions I'm hoping you can help with.How can I move the command panel from the top to the left as...
Issue #839
[QUESTION] Create custom selected component settings
There is a option in panel to change setting of component (For links, there is an option no change link - HREF - and target, for texts, id...
Issue #945
[QUESTION / FEATURE REQUESTS] : How to translate grapejs
Hi, I check the sources but it didn't seems to have a centralized language file (one per plugins per example) but multiple places where wor...
Issue #1259
Toolbar and Actionbar Postion
Hi @artf. How can I update position of Toolbar and Actionbar as it override the each other and toolbar also hide the highlighter text like...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.