Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modal] { inverted: true } works only on the first run. #3192

Closed
alexandretperez opened this issue Oct 15, 2015 · 5 comments
Closed

[Modal] { inverted: true } works only on the first run. #3192

alexandretperez opened this issue Oct 15, 2015 · 5 comments

Comments

@alexandretperez
Copy link

$('.ui.modal').modal({ inverted: true }).modal('show');

Shows the modal with white background. After you close it and then open it again the background is now black.

Run Code twice at "Dimmer Variations" section to see the bug:
http://semantic-ui.com/modules/modal.html#/examples

@alexandretperez alexandretperez changed the title [Modal] { inverted: true } works only on the first time. [Modal] { inverted: true } works only on the first run. Oct 15, 2015
@jlukic
Copy link
Member

jlukic commented Nov 7, 2015

This is a bug related to doc initialization (the modals are re-used in all the examples), but I don't believe a bug with SUI?

@alexandretperez
Copy link
Author

I did some changes and now it works.

Was need instantiate the modal only once.

Here is the test case:
http://plnkr.co/edit/RnUqli4JnYIuxs9v88YC

@larsbo
Copy link
Contributor

larsbo commented Jan 20, 2016

I got the same unexpected behavior. Here is a common use case with an modal which lost it's inverted state after fired once: http://jsfiddle.net/8x15wobw/
The same result with dimmerSettings:

dimmerSettings: {
    variation: 'inverted'
}

@brunotourinho
Copy link

same problem here, even in the Examples pages the bug occurs:

http://semantic-ui.com/modules/modal.html#dimmer-variations

on the first call to inverted modal, the dimmer is clear, if you make a second call, the dimmer goes dark.

larsbo added a commit to larsbo/Semantic-UI that referenced this issue Feb 8, 2016
During the second dimmer run the color was extracted from the DOM. At
least Firefox automatically converts RGBA to RGB if possible which
caused the bug.

With this fix the dimmer module can now detect both RGB and RGBA colors.
larsbo added a commit to larsbo/Semantic-UI that referenced this issue Feb 8, 2016
larsbo added a commit to larsbo/Semantic-UI that referenced this issue Feb 8, 2016
larsbo added a commit to larsbo/Semantic-UI that referenced this issue Feb 8, 2016
During the second dimmer run the color was extracted from the DOM. At
least Firefox automatically converts RGBA to RGB if possible which
caused the bug.

With this fix the dimmer module can now detect both RGB and RGBA colors.
jlukic added a commit that referenced this issue Feb 15, 2016
@avalanche1
Copy link
Member

@larsbo , you should not instantiate your modal on every click.
http://jsfiddle.net/8x15wobw/1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants