Issue #3230Opened January 13, 2021by alivex0 reactions

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)

artfJanuary 26, 20210 reactions

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?!

no-response[bot]February 5, 20210 reactions

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.

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.