Issue #2483Opened December 31, 2019by andrewryan19061 reactions

Default model names not persisting to local storage

Question

When I create a new Dom Component, I give it a name in the "defaults" section, like:

domComponents.addType(''ugly-type-name', {
 model: {
        defaults: {
          tagName: 'component',
          name: 'Foo Bar',   <-----
   
          attributes: {

            'component-id': component.id
          },

          traits: [{}

          ]
        }
      },

When the component is dragged on to the canvas, the Foo Bar string shows up as a badge like it should, and the text appears in the Layers panel and everything is good. But when the canvas is persisted to storage, and I refresh the page, the badge now shows the ugly-type-name, and it appears in the layers as well.

What am I doing wrong?

Answers (2)

pouyamiralayiDecember 31, 20191 reactions

@andrewryan1906 please define your component type inside a plugin. cheers!

andrewryan1906January 2, 20200 reactions

That works, thanks!

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.