vue-thin-modal icon indicating copy to clipboard operation
vue-thin-modal copied to clipboard

When opening a modal window in a component that is in the current modal window, an error occurs

Open cvaize opened this issue 5 years ago • 3 comments
trafficstars

When opening a modal window in a component that is in the current modal window, the old modal window is unmounted from the dom, which leads to unmounting the component that caused the new window and the new window does not open. image

cvaize avatar Oct 21 '20 12:10 cvaize

To recreate the error, create a component that has a button that opens a modal window and place this component in another modal window. Open another modal window, and then click the button that is located in the component that calls the new modal window. As a result, the component in the modal window will be destroyed and the new modal window will not be displayed, and the page scroll will be blocked.

cvaize avatar Oct 21 '20 12:10 cvaize

To get around this, I had to duplicate the components and move them out of the modal window. I made it so that when a click is triggered, an event is called on the rendered components. image

cvaize avatar Oct 21 '20 12:10 cvaize

I suggest making a mode in which one or all modal Windows are always in the dom. By v-show type

cvaize avatar Oct 21 '20 13:10 cvaize