BUG: Modal won't open after closing it dynamically
Question
Hello;
Thank you guys for the great tool, I just love the documentation, the easy to use/understand. I think I ran into an issue with the modal not opening again after closing it dynamically the first time. example:
editor.on('modal:open', () => this.openModalHandler(editor));
openModalHandler(editor){
const model = editor.getSelected();
const modal = editor.Modal;
const {type} = model.attributes;
modal.close();
switch (type) {
case 'image':
case 'section':
return this.addBackgroundImage(type);
}
}
Answers (2)
I can't reproduce it on the official demo, eg.
editor.on('modal:open', () => {
console.log('Modal opened');
setTimeout(() => {
console.log('Close modal');
editor.Modal.close()
}, 2000)
});
But just checking your code I'd say it doesn't open because you're closing it immediately after (just after the open is triggered), am I missing something?!
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1696
Traits appear first time when draged custom component
Hi artf , i have created custom component and add traits for it , when dragging this component to editor and select it the setting traits w...
Issue #1468
[bug] modaltitle no effect
Hello, I can't translate asset manager title to french. Example : assetManager: { storageType: '', storeOnChange: true, storeAfterUpload: t...
Issue #5141
BUG: component resets attribute values on updating traits ( first time only )
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 113.0.5672.63 Reproducible...
Issue #3075
BUG: Unhandled Rejection (TypeError): i.classList is undefined
Hi. I updated GrapesJS to its current version 0.16.22 and I get an error on the callback function: editor.on("component:add", (model) => {...
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.