Grapesjs bootstrap modal
I managed to make it work, but honestly it was just not worth the trouble since the export modal looks better with the original grapesjs modal :)
Read full answer below βQuestion
How do we go about replacing the grapesjs modal with a bootstrap modal? For example, say I want to open the export modal of the MJML lib. I created the html element in my view:
<div class="modal fade" id="export-template" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updatePasswordLabel">Export template</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col">
<div id="exportModalContent"></div>
</div>
</div>
</div>
</div>
</div>
</div>
Then I override command-export-mjml.js with
const container = document.getElementById("exportModalContent");
and
$("#export-template").modal('show');
modal.open();
But this opens both BS modal and grapesjs modal, yet the grapesjs modal is outside the BS modal.
Answers (2)
I managed to make it work, but honestly it was just not worth the trouble since the export modal looks better with the original grapesjs modal :)
Actually, we don't have any public API to extend the built-in modal.
BTW, did you try just not calling modal.open()?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1588
[QUESTION]
Hi guys and thank you for your magnificent work and this API! I have a question about the box, which wraps all components after saving. For...
Issue #399
[Question] Can i push toolbar in current modal and current modal child?
Hello again @artf , i confuse about push toolbar in the element with specific class (ex: modal-trigger) the element code is : and in the /s...
Issue #3135
[Help Wanted] How to easily override existing component ?
For example, I want to add a double click event handler on the default video component to open the assets manager. My basic idea was to get...
Issue #3524
[QUESTION]: Integrate select2 UI element into traits
I'm new to grapesJS ... Great tool.I have a few questions about traits. I followed this tutorial https://grapesjs.com/docs/modules/Traits.h...
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
Building an AI-Assisted Document Engine with Next.js, GrapesJS, and the AI SDK
Transform your static template editor into an intelligent, generative design workspace with Vercel AI SDK, AI Elements and Next.js.
Tutorial
Ship to Production Faster: Whatβs New in GrapesJS Shadcn
Supercharge your page builder! GrapesJS Shadcn adds live drag previews, rich text / commands, dynamic data, and canvas presets to ship to prod faster.
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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.