[Bug] when removing a tooltip its css is not removed
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 #2802
[BUG] editor get stucked when switching selection quickly between controls
DescriptionThe bug is reproduced on the current demo What happens ? When switching selection quickly between controls , the editor get stuc...
Issue #2422
[BUG] Unable to add 'space' character if zoom is applied on canvas
Cannot edit text components properly if a zoom value is applied on the canvas. GrapesJS version:0.15.8 The issue can be reproduced in the d...
Issue #3291
BUG (v0.16.41): the duplicate icon from the icon toolbar is modifying the original element too
Version: v0.16.41 Are you able to reproduce the bug from the demo? [ ] Yes What is the expected behavior? The elements duplicated not shoul...
Issue #3134
BUG: Canvas scroll to top of the page when I try to drag an element from the last sections
Version: 0.16.27 Are you able to reproduce the bug from the demo? [ X] Yes [ ] No What is the expected behavior? When a try to drag a compo...
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.