Issue #1875πŸ’¬ AnsweredOpened March 10, 2019by simplecommerce1 reactions

ID changes when importing html or passing html in components prop in config.

Quick answerby artf❀ 1

@simplecommerce new release published

Read full answer below ↓

Question

Hi,

I built a component and block that I can drag and drop in the canvas.

My issue is that some styles rely on the ID. I know this might not be ideal, but it's like this at the moment.

My problem is when I reload the editor with my previous values by passing it in the components prop, all my ID's are changed.

Is there a way to prevent this?

Like, only change ID's for newly added blocks and not imported code or existing code?

I tried searching but could not see an option.

Thanks!

Answers (3)

artfβ€’ March 24, 2019

@simplecommerce new release published

simplecommerceβ€’ March 15, 2019

Anyone have any idea for this issue? My issue happens when I use for example, bootstrap tabs, in order to make them work and load the right tab, it uses the ID, but since the ID is being regenerated when I load the editor with my components again (for editing), the tabs no longer work, since all ID...

sbiwaichoonβ€’ March 16, 2019

same issue here.if i have use that id in code, id change when(id-2) reload template to grapejs (auto added "-2" to my id) , if i dont use that id in any part of my code, is fine, id wont change

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.