-
Notifications
You must be signed in to change notification settings - Fork 18
Using with iron-list causes top border to be hidden #73
Comments
Increase z-index of the ::before element to stay on top of content elements.
You can style the paper-dialog-scrollable:before {
z-index: 1;
} I would recommend this instead of having paper-dialog-scrollable set the z-index, in order to have it unopinionated about z-index and stacking context, wdyt? |
That doesn't seem to address the issue. I think the purpose of the scrollable region is pretty much to solely put/take away those lines at the top and bottom. Otherwise, I wouldn't bother to use it. I think the behavior, as described, is a bug and should be fixed in this element. The problem is that a new stacking context is created inside of the |
Agreed, this is the expectation. The scrollable region though doesn't have control over the stacking contexts created by the content (iron-list and its items). If Another thing to note here is that If the desired behavior is to render all the items, then you're better off using <style>
.sizer {
height: 300px;
width: 200px;
}
.list-item {
/* grid-like layout */
display: inline-block;
margin-left: -2px;
background-color: white;
width: 100px;
height: 100px;
}
</style>
<paper-dialog id="foo">
<h2>Hello</h2>
<paper-dialog-scrollable>
<div class="sizer">
<template is="dom-repeat" id="list">
<div class="list-item">
[[item.name]]
</div>
</template>
</div>
</paper-dialog-scrollable>
<h2>World</h2>
</paper-dialog>
<script>
document.querySelector('#list').items = new Array(100).fill({name: 'Wes'});
document.querySelector('#foo').open();
</script> Here a version with iron-list correctly sized: https://jsbin.com/visiji/6/edit?html,output <style>
iron-list {
height: 300px;
width: 200px;
}
.list-item {
background-color: white;
width: 100px;
height: 100px;
}
paper-dialog-scrollable::before {
z-index: 1;
}
</style>
<paper-dialog id="foo">
<h2>Hello</h2>
<paper-dialog-scrollable id="scrollable">
<iron-list id="list" grid>
<template>
<div class="list-item">
[[item.name]]
</div>
</template>
</iron-list>
</paper-dialog-scrollable>
<h2>World</h2>
</paper-dialog>
<script>
document.querySelector('#list').scrollTarget = document.querySelector('#scrollable').scrollTarget;
document.querySelector('#list').items = new Array(100).fill({name: 'Wes'});
document.querySelector('#foo').open();
</script> Notice the |
In this simple example to demonstrate the bug, you're right about everything. However, in my real use case, I would essentially have to reimplement This problem is just caused by the 3d-translate that iron-list is doing to create the grid. |
Description
Top border gets hidden by contents, specifically when using
iron-list
.Expected outcome
The
:host(.is-scrolled:not(:first-child))::before
should be above the scrollable's contents.Actual outcome
The lack of a
z-index
causes:host(.is-scrolled:not(:first-child))::before
to be covered by the contents of theiron-list
.Live Demo
https://output.jsbin.com/wuqafigoha
Steps to reproduce
Scroll down.
See that
0z
transform3d
items of theiron-list
cover the top border.Setting the
::before
element'sz-index: 1
in thepaper-dialog-scrollable
fixes the issue.Browsers Affected
The text was updated successfully, but these errors were encountered: