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

[React-wrapped components]: Issues with class fields #12087

Open
2 tasks done
andy-blum opened this issue Oct 30, 2024 · 0 comments · May be fixed by #12088
Open
2 tasks done

[React-wrapped components]: Issues with class fields #12087

andy-blum opened this issue Oct 30, 2024 · 0 comments · May be fixed by #12088
Assignees
Labels
bug Something isn't working dev Needs some dev work package: web components Work necessary for the IBM.com Library web components package

Comments

@andy-blum
Copy link
Member

Description

React-wrapped components are having issues within container/composite/component suites with errors like:

Error: The following properties on element ELEMENT will not trigger updates as expected because they are set using class fields: ...

Specifically:

Component Field
c4d-megamenu-tab hideDivider
closeOnActivation
c4d-locale-search inputTimeout

Relevant Lit Docs: https://lit.dev/docs/components/properties/#avoiding-issues-with-class-fields

The megamenu-tab code looks like this:

@customElement(`${c4dPrefix}-megamenu-tab`)
class C4DMegaMenuTab extends CDSTab {
  /**
   * Disable unneeded properties inherited from CDS Content Switcher Item.
   */
  closeOnActivation = false;
  hideDivider = false;

  render() {
    ...
  }

  static styles = styles;
}

I'm guessing we can accomplish the same goal in a lit-specific way by updating those values within connectedCallback or firstUpdated methods.

Component(s) impacted

c4d-megamenu-tab, c4d-locale-search

Browser

Firefox

Carbon for IBM.com version

v2.14.0

Severity

Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.

Application/website

unknown

Package

@carbon/ibmdotcom-web-components

CodeSandbox example

https://stackblitz.com/edit/nextjs-ak9hzz?file=pages%2Findex.js

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

@andy-blum andy-blum added bug Something isn't working dev Needs some dev work labels Oct 30, 2024
@andy-blum andy-blum self-assigned this Oct 30, 2024
@andy-blum andy-blum changed the title [YOUR TITLE]: Brief description [React-wrapped components]: Issues with class fields Oct 30, 2024
@andy-blum andy-blum added the package: web components Work necessary for the IBM.com Library web components package label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Needs some dev work package: web components Work necessary for the IBM.com Library web components package
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant