Fomantic-UI
Fomantic-UI copied to clipboard
[modal] `show` breaks modal state if more configuration is done before transition finish
Bug Report
Steps to reproduce
- open https://jsfiddle.net/dzus4r5L/
- click outside the modal (somewhere in the gray dimmer)
- 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
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/
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