Skip to content

Error when using custom-elements in collection views #2

@luckydye

Description

@luckydye

When using the code below in a collection, I get a bunch of errors and the panels are not usable anymore.

try {
  customElements.define("a-xyz", class XYZ extends HTMLElement {});
} catch (err) {
  console.error(err);
}

class Plugin extends CollectionPlugin {
  onLoad() {
    this.views.register("table", (viewContext) => {
      const $element = viewContext.getElement();
      $element.innerHTML = /* html */ `<a-xyz style="height: calc(100vh - 290px);width: 100%;"></a-xyz>`;
    })
  }
}

Results in:

app-63FFH6CQ.js:230 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'onLoad')

and many more following...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions