Muuri: WebComponents coming

Created on 14 Dec 2018  路  6Comments  路  Source: haltu/muuri

Hi! Could you rework this codes for Web components:

  1. Grid already takes container as dom element and it works fine for Web components but except for this if condition.
    https://github.com/haltu/muuri/blob/e40391e1554c1ac6c9b6e19c1971eea0a00c56be/src/Grid/Grid.js#L110

    I think it will be enough to check it like this:

element.isConnected 

polyfill isConnected if needed

  1. parentNode of the element inside shadowDom is DocumentFragment.
    https://github.com/haltu/muuri/blob/master/src/Item/ItemDrag.js#L1300

I would add one condition for that:

if (parent instanceof DocumentFragment && parent.getRootNode) {
      parent = parent.getRootNode().host;
      continue;
}

Thanks in advance

question

Most helpful comment

Merged to dev -> will be out in the next release 馃挭 Thanks for the PR @stat92 馃憤

All 6 comments

Ummm yeah, if that check is causing some issues with web components I guess we can just remove it and add a note about it in the docs. Do you have a live example which shows this issue?

Thinking about this a bit more... it might be better to build live test case using muuri with web components and see if there's any additional issues. Would be great to have tests with web components too.

If you're up for getting started with this and do a PR with all the updates I'm more than happy to help out where I can :)

Thank you for fast answer. I am using Muuri now with two changes shown above without problems. And it's working now. I can PR that changes & keep an eye on another issues with WC.

Big bump on the web-components side of things. I'm using the pull request from @stat92 and it's working great. Any chance we'll see this in conjunction with #262 ?

@anoblet there's a good chance for that yes 馃檪

Merged to dev -> will be out in the next release 馃挭 Thanks for the PR @stat92 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

realsoelynn picture realsoelynn  路  4Comments

who519 picture who519  路  7Comments

ppwfx picture ppwfx  路  4Comments

dedurus picture dedurus  路  4Comments

argie09 picture argie09  路  6Comments