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

absolute/fixed positioned elements inside row-detail #174

Open
kamil-maslowski opened this issue Nov 30, 2016 · 8 comments
Open

absolute/fixed positioned elements inside row-detail #174

kamil-maslowski opened this issue Nov 30, 2016 · 8 comments

Comments

@kamil-maslowski
Copy link

There's an issue with absolute/fixed elements that are inside row-detail as they are overlapped by other list item elements.

It makes problems when e.g. implementing datepicker inside details row.

Please see attached
screen shot 2016-11-30 at 12 28 58

@web-padawan
Copy link
Contributor

the reason is that iron-list uses transform property: PolymerElements/iron-list#242

@kamil-maslowski
Copy link
Author

As I thought... but is there any legit way to fix that when using iron-data-table?

@web-padawan
Copy link
Contributor

web-padawan commented Dec 1, 2016

I used to fix it like this, but now I ended up with creating brainy-table which uses dom-repeat (and I'm going to implement pagination to deal wit big amounts of data).

@kamil-maslowski
Copy link
Author

Yeah, found the z-index fix myself... but that works only "one way", from top to bottom, and if something will pop to top, earlier elements will overlap over it.

Other than that... how did you managed to set z-index on list items?

@web-padawan
Copy link
Contributor

web-padawan commented Dec 2, 2016

@kamil-maslowski here is the solution to calculate z-index. Paste this code in beforeRowBind:

var items = Polymer.dom(table.$$('#list')).querySelectorAll('div.item');
items.forEach(function (item, index) {
    item.style.zIndex = items.length - index;
});

@kamil-maslowski
Copy link
Author

@web-padawan I did that kinda different to overcome the problem with previous rows overlapping elements:

_beforeRowBind: function(data, row) { row.parentNode.style.zIndex = data.expanded ? "1" : null; },

just fyi ;)

@web-padawan
Copy link
Contributor

@kamil-maslowski please take into account that using ?dom=shadow (or enabling native shadow DOM in global Polymer settings) changes table structure. There is a trick with <content> element and node distribution :)

@anooprajan89
Copy link

@web-padawan I tried your code.

var items = Polymer.dom(table.$$('#list')).querySelectorAll('div.item');
items.forEach(function (item, index) {
item.style.zIndex = items.length - index;
});

But the issue coming opposite. In my issue, the calendar shows upward is fine. Downward is behind the column. After using your code, It's coming opposite(downword is fine, but upward is going behind table).
Can you figure it out?

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

No branches or pull requests

3 participants