When removing a tooltip its css is not removed
Yeah, I think you're right, probably replacing with might fix the issue, would you like to check and create a PR? :)
Read full answer below ↓Question
Description
- The bug is reproduced on the current demo
Expected behavior
- When a tooltip is removed its css is removed
What happens instead ?
- When a tooltip is removed its css is not removed
Steps to reproduce on the demo
- Clear the canvas
- Drag a tooltip
- Remove the tooltip
- Click on Import button on top toolbar , the tooltip css is not removed .

The conclusions of my research
Trying to understand this bug i notified that the style-signature feature is not working properly .
My supposition is that the bug occurs inside the run method of the command core:component-style-clear .
On Components model the core:component-style-clear command run before the component is removed . So when the core:component-style-clear command check if an element of a specific type exists yet on the canvas the response is true . Then this condition is false and the css is not removed .
Answers (3)
Yeah, I think you're right, probably replacing
// relies on the view
const len = dc.getWrapper().find(`[data-gjs-type="${type}"]`).length;
with
// relies on the model
const len = dc.getWrapper().findType('tooltip').length;
might fix the issue, would you like to check and create a PR? :)
@artf
Maybe this code to keep the code generic ?
// relies on the model
const len = dc.getWrapper().findType(type).length;
@meyerco 😅 yeah sure, sorry, it was a copy-paste from my try
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3125
linear-gradient CSS does weird things to background-image
Version: 0.16.27 Are you able to reproduce the bug from the demo? [x] Yes [ ] No What is the expected behavior? When adding background-imag...
Issue #5083
Blocks are not draggable to canvas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Tauri Reproducible demo link Describe the...
Issue #3295
BUG (v0.16.41): Button component with draggable property is not working properly
Version: v0.16.41 Are you able to reproduce the bug from the demo? [ ] Yes [ ] No What is the expected behavior? When we have a button with...
Issue #3166
Problem with copy and paste a node
*Version:0.16.27 Are you able to reproduce the bug from the demo? [ ] Yes [ ] No What is the expected behavior? In the right panel and canv...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline — both $69.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.