Git Product home page Git Product logo

Comments (15)

bigopon avatar bigopon commented on May 31, 2024

@wzrdtales thanks for the issue. This is likely because it's configured to use shadowdom globally, which means every component has shadow dom turned on by default. This causes a conflict with containerless since there's no host to attach shadow to. I guess in your case you want to disable the shadow dom for this particular component to enable containerless for it. This is tracked in #1772
Any thoughts @3cp , maybe temporarily we can enable a way to disable shadow dom per component.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

thanks for your response. I tried already deactivating it with useshadowdom(false), but it still throws the same error despite it

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

I added @useShadowDOM(false) actually to both components, the main that includes the sub component and the subcomponent itself. Error stays unfortunately the same. Did something change and this disabling doesn't work anymore?

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

sorry correction @bigopon

The error changes, to this one instead:

Failed to execute 'attachShadow' on 'Element': The provided value is not of type 'ShadowRootInit'.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

Correction again, only if I apply it to the main component, if only to the subcomponent it stays AUR0501

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

I tried as-element as well which is broken with the same error Failed to execute 'attachShadow' on 'Element': The provided value is not of type 'ShadowRootInit'.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

The only thing that yet did not throw an error, but instead the element just disappears and does not get rendered anymore was

@customElement({
  name: 'instance-table-item',
  containerless: true
})

from aurelia.

3cp avatar 3cp commented on May 31, 2024

In template, we have a way to optionally turn on shadow dom, or override the mode.

https://github.com/aurelia/aurelia/blob/master/packages-tooling/plugin-conventions/src/strip-meta-data.ts#L129-L135

The simplest solution would be extend that <use-shadow-dom> tag to add an attribute to turn it off.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

But isn't this the same as @useShadowDom(false) which didn't work? Or does this differ?

from aurelia.

3cp avatar 3cp commented on May 31, 2024

I was only answering @bigopon's question about the template feature. Not sure what's the cause of this particular issue.

Yes, @useShadowDom(false) sounds doing the same.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

ok, then yeah, this wont solve it unfortunately then. I tried that same error as stated before and even more weird errors when I go down the chain Failed to execute 'attachShadow' on 'Element': The provided value is not of type 'ShadowRootInit'.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

I found a solution #1772

I just wondered, here in this issue it claims useShadowDom(null), while your documentation says false. I just tested null, and with that it starts working oO

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

But my issue was that out of the table element, the container got thrown out. Even with containerless it still ends up outside the table tag.

from aurelia.

wzrdtales avatar wzrdtales commented on May 31, 2024

exchanging the same with

<tbody
          class="text-sm"
          repeat.for="order of orders"
          order.bind="order"
          key.bind="order.id"
          value.bind="order.id"
          as-element="instance-table-item"
        ></tbody>

now works, so somehow aurelia seems to early output to the browser the original container name and the browser throws it out of the table structure.

from aurelia.

Sayan751 avatar Sayan751 commented on May 31, 2024

AFAIK, it is a known phenomenon with <table>. The schema of the table and what elements are permitted to be nested inside it is very tightly defined (refer to the permitted elements for <table> in the MDN docs).

I am closing this for now, as it seems to me it is a not an Aurelia-issue and that a working solution is found by the OP anyway. If I am mistaken, feel free to reopen.

from aurelia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.