-
Notifications
You must be signed in to change notification settings - Fork 131
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
List items overflow content hidden beneath lower items #242
Comments
Great issue, I got the same issue and waited for the fix as I thought there were other issues solving it - but they did not yet. I can add Safari to the list of affected browsers. Closed issue that did not solve the problem : Still open issue that might be related : |
The one question that comes up for me with your proposed fix is, what do you expect people who's overflow content goes up out of the item (like the third option "bottom left aligned", here: https://elements.polymer-project.org/elements/iron-dropdown?view=demo:demo/index.html&active=iron-dropdown) to do with this fairly hard fix for one version of this issue? Seems like something that would need more flexibility if included in the main codebase or that should be handled by the implementer instead of the component. Thoughts? |
That's a valid point, it doesn't handle dropdowns that extend above the top of the list item, but I can't think of a good general solution, since the problem is caused by iron-list items' stacking contexts, but caused for unrelated elements. |
Does it seem like a lack of optimization for the implementer to manage their own z-index? a la:
This could of course be managed more clearly and repeatably in a non-[is="dom-bind"] situation, but I think this allows you to cover your use case and others to manage z-index as they see fit for their implementation. |
Given the probable complexity of a general solution, I'd be OK managing item z-indexes as an implementer, but is there not a cleaner way to do so without wrapping everything in a |
That was just quickie short-handing on my part. There's no reason why it couldn't be done in a bunch of other ways. I usually wrap all of that into its own component, which helps me keep my implementations reusable across a growing code base. |
This is because the DOM nodes that iron-list manages have |
|
Is there any progress? Using |
any update on this one? thanks guys for all the awesome elements! |
Listen for the menu open event and change the z-index of that row to '1'. On menu close, reset z-index. Works on paper-dropdown-menu and related elements.
@sravan-s unfortunately this only works in |
@blasten would you have a jsbon for that? (similar issues arise with other elements embedded in the iron-list such as a paper-dialog so a generic solution/hack would be great in the meanwhile) Cheers |
I was trying to use |
@blasten what about using |
UPD: any So there is nothing to do here with My current workaround is to set 'z-index' property for each
|
Any update on this? |
FYI this affects Opera as well. |
@web-padawan workaround is working for the moment. Thanks! If anyone is interested in how to get this dynamically working in conjunction with iron-ajax. Here's my approach: Add this to your iron-ajax call: Register these functions with polymer: // calculate z-index
getIndex: function(itemIndex) {
return this._jsonReceived()-itemIndex;
},
// Count json items
_jsonReceived: function() {
return this.data.data.length;
} Modify iron-list template to print correct z-index: |
I found that reorganizing my structure to the like of how they have it structured in the PolymerElements/iron-scroll-threshold page fixed the issue for me at least. I started with
and refactored this to
I hope this may help. |
Description
If an iron-list of items with overflow content (eg. dropdown menus) is used, an item's overflowing content will be hidden by the following item, as the lower item will have a higher stacking level.
I've got a fix for this, which sets the z index of each list item to the list size minus the item's list index, ensuring that earlier items stack above later items. The fix is here (with a demo for list items containing dropdown menus), but I occasionally rebase my fork to keep it up-to-date with this repository, so if that link doesn't work, the branch it's in is here. I can turn this into a PR, but there's no test because it's a visual bug fix and I don't know how you'd test that.
Expected outcome
Given the correct styling (eg.
overflow: visible
), an item's overflow content should appear on top of content items lower in the list, as is commonly the case with dropdown menus.Actual outcome
Overflow content appears beneath items lower in the list, making (for example) dropdown menus that are taller than the element they appear for unusable.
Live Demo
https://jsbin.com/sihuxoxaka/edit?html,output
Steps to reproduce
See the above live demo, which was adapted from the demo page added in the commit I linked to above.
Browsers Affected
Other browsers are untested.
The text was updated successfully, but these errors were encountered: