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

Error in UI5Metadata when inheriting a web component #454

Closed
Psidium opened this issue May 28, 2019 · 1 comment · Fixed by #1092
Closed

Error in UI5Metadata when inheriting a web component #454

Psidium opened this issue May 28, 2019 · 1 comment · Fixed by #1092
Assignees

Comments

@Psidium
Copy link
Member

Psidium commented May 28, 2019

Describe the bug

When inheriting a UI5 Web Component, the metadata gets wrongly merged into the resulting component. The top-most prototype in the hierarchy will override any shared key of properties, slots and events.

To reproduce

Having this file inheriting the TableRow:

import TableRow from "@ui5/webcomponents/dist/TableRow";

class SingleTableRow extends TableRow {
    static get metadata() {
        return {
            ...TableRow.metadata,
            tag: 'ui5-table-single-row',
            slots: {
                cells: {
                    type: Object,
                    multiple: true,
                    individualSlots: true,
                }
            }
        };
    }
}
SingleRow.define();

This class only redeclares the metadata to allow any div into a table, not just ui5-table-cell.

When trying to add a div in this new object, there is an error, this error is thrown because of the getMetadata() method returns the content of the TableRow's metadata instead of this class',

Expected behavior

The object extending the Component can override any property of the metadata property.

Context

  • UI5 Web Components version: 0.11
  • OS/Platform: Mac

Affected components

All

@MapTo0
Copy link
Member

MapTo0 commented May 28, 2019

Unfortunately, our base project is not yet ready for public consumption and will evolve and change a lot in the future. We might somehow hack this but I would not recommend it. I hope that if we can achieve the referenced feature (#455) this can be skipped for now.

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

Successfully merging a pull request may close this issue.

3 participants