Fomantic-UI icon indicating copy to clipboard operation
Fomantic-UI copied to clipboard

[modal] `show` breaks modal state if more configuration is done before transition finish

Open mvorisek opened this issue 1 year ago • 1 comments

Bug Report

Steps to reproduce

  1. open https://jsfiddle.net/dzus4r5L/
  2. click outside the modal (somewhere in the gray dimmer)
  3. the modal is expected to close

Expected result

Modal always closes when the dimmer is clicked if configured so.

Actual result

The modal does not close if the 2nd or 3rd JS modal call in the jsfiddle is present.

The show cannot be synchronous as the transition takes time. This is expected. However, it seems when the transition is in progress, configuring modal further (empty configuration in the 3rd JS call in the jsfiddle) breaks the internal state.

Version

latest

mvorisek avatar Jan 19 '24 10:01 mvorisek

It's not about the transition but the new redeclaration of the same modal while the modal is shown. Try this https://jsfiddle.net/lubber/kgyrbh21/5/

Even though the recreation is done around 2 seconds after the transition has finished the dimmer again isnt clickable.

try the same, but close the modal via the close button just before the 2s timeout is reached. Then the second declaration works and the dimmer is clickable.

So, we would need to either block/deny a recreation while a modal is shown or autoclose it before (not sure it this will work, needs testing.) If you hide the modal just before redeclaring it, it also works https://jsfiddle.net/lubber/kgyrbh21/8/

lubber-de avatar Feb 14 '24 18:02 lubber-de

Closing as wont fix, as a recreation of a modal while the modal is already in progress (shown) is not supported. If one needs to change settings while the modal is shown, use the setting behavior instead.

See #3020 and #3030 as duplicates

lubber-de avatar Apr 05 '24 22:04 lubber-de