-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Popup: zIndex is not applied in v2 #4083
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
@JMS-1 thanks for reporting this, this is a definitely valid issue. This change is a part of #3947: Semantic-UI-React/src/modules/Popup/Popup.js Lines 178 to 182 in 1fbeed9
It was done to avoid positioning issues with Popper.js as margins on containers are not handled anymore. As we don't control styles on our side we cannot simply remove Sorry for this unobvious change, I didn't take that it can affect apps... However, I tried different options before and I don't have a better solution there.
<Popup unstable_container={{ className: 'foo', data-id: 'container', style: { zIndex: 10000 } }} /> Will it work for you? |
Actually on first thought using Popup in Modal seems not be so rare - Modal for some Input Form, Popup for errors therein - so the solution seems to be a bit strange. But indeed I think we have only few places and could live with it. I would have done something like this in CSS IF the container div hat at lease ANY class attached to ist but it hasn't. In F12 developer mode z-index: 1000 did the job. So to summarize: yes, this will work for us. But it feels wrong (sorry) and personally I would prefer to have some class on the container IF this is possible (even data- would do) but as I understand this isn't. Thanks Jochen PS: Thought by the side: why not putting an ADDITIONAL own div (absolute/0/0) around the container? |
Any way to supply a class/style for parent will do. But don't give it a name of |
I've patched locally my semantic-ui with popperStyle = _extends({zIndex: 1900}, popperStyle); In here: Semantic-UI-React/src/modules/Popup/Popup.js Line 177 in 1fbeed9
And it solved the issue. |
Do you think it's a good idea to have the z-Index in code? Wouldn't it be better to add some (new?) class and style the z-Index in? |
It may be good enough to add .ui.popup to this div, it will definitely solve the problem |
The problem is that the this lib (React version of SUI) can't make changes in the CSS... it just relays on the original styles. |
I think that the comment here Semantic-UI-React/src/modules/Popup/Popup.js Lines 178 to 182 in 1fbeed9
|
|
and |
Just to clarify, this change is a part of Why additional
|
Since the value is hard coded in the css, there is no need to sync it. |
@felixmosh it can be the first iteration, however the issue that z-index: @zIndex; /~https://github.com/Semantic-Org/Semantic-UI/blob/master/src/definitions/modules/popup.less#L34 IMO, at least we should sync the initial value in |
Agree with syncing it in |
Hello everyone. Have workaround? |
|
@felixmosh Can we without fork?. Because i don't want to do fork |
@sergeu90 I'm using It allows you to modify the files in |
@felixmosh Thanks. I see you created pull request. |
@sergeu90 Expanding upon @felixmosh's workaround, for people unfamiliar with
This worked for me in a meteor project. |
Using popperModifers, you can use this workaround to apply directly on your Popup :
|
@Blapi It is cool decision. But we have many popup in the code and in each add this workaround not nice |
actually I prefer the solution where the zIndex is not fixed in code - although up to now we never messed with the zIndex on semantic dialogs but you knows. So as long this isn't fixed we prefer a bit of a manual work-around which seems (only tested on one place) to work. Step 1 is to provide a global method (TypeScript version) Step 2 is to use it on every Popup.Content where it is necessary (in fact not all Popups come on as a problem and perhaps this is not applicable to the DateTimeInput problem - didn't check) In addition I still can't understand why it's so hard to "fix the fix" in suir itself - the outstanding PR uses a hardcoded 1900 and IMHO this is not an option. Ok, so in suir 2 you added an additional div for some good reasons. Why not simply propagate the zIndex from the inside to this new element when it's mounted - e.g. like the syncZIndex approach mentioned earlier? Regards Jochen |
@sergeu90 Indeed, this is why we took the decision to create a wrapper for the SUIR Popup
And then replace each SUIR Popup in our codebase with a simple find & replace + a script to adding the imports (~60 files so it was not hectic) And nothing was broken as we always used the But I can understand your point if you are not in my kind of situation, just want to point out that you can do this instead of adding this fix in every Popup that you have ! |
Folks please stop fixing this issue on your side, it will be fixed in SUIR on next week. If it creates issues for you just stay few days on 1.x until 2.0.1 will be released. I have personal issues that's why it's not fixed yet... |
Thanks every for reporting and suggestions ❤️ I fixed the issue in #4094 (visual tests were also added), BTW |
Released in |
@layershifter just in time for me, thx :) |
Bug Report
Steps
Originally we have a Popup inside a Modal. On hover the Popup will not show up.
Expected Result
Should behave as in 1.3.1.
Actual Result
Popup is behind the Modal.
Version
2.0.0
Testcase => Reason
The
The class is set one level below the outer div and the z-Index (1900) is no longer able to move the Popop contents above the modal.
The text was updated successfully, but these errors were encountered: