Issue #3018Opened September 11, 2020by dharmatv2 reactions

Page refresh preventing after click on import

Question

Version: 0.15.9

Are you able to reproduce the bug from the demo? Yes

What is the expected behavior? Don't refresh the page after clicking on import buttion

Describe the bug detailed I have included this component(grapesjs) in b-form. In which we have an import option right so I have clicked on that button it will refresh the entire page with adding of URL query params like following

<b-form> <grapesjs></grapesjs> </b-form>

URL query params: http://localhost:8080/`**?text-align=left&text-decoration=none&font-style=normal&border-collapse=separate**`#/examples/form

What is the current behavior? It refreshing the entire page after clicking on the import button

Describe the bug detailed

Refreshing entire page when I am clicking on the import button

Are you able to attach screenshots, screencasts, or a live demo?

Yes https://drive.google.com/file/d/1FsRxtize5UL1XLic_7F6S3CO91_ctauh/view

Could u please help anyone how to do resolve this

Thanks

Answers (3)

dharmatvNovember 9, 20202 reactions

Thanks @artf I got solution, please check following solution if anyone need Sol:

md.getModel().on("change:open", function () {
          // Your logic
      });
artfSeptember 14, 20200 reactions

Probably it submits the page because the import button doesn't have type="button" so it acts as type="submit" inside a form element

dharmatvSeptember 14, 20200 reactions

@artf I know that, but how can I add a type for the import button

note: I know how to add dynamically by using js. Without that, any other solution in grapesjs

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.