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

Missing Flow component for Html element: <code> #20832

Open
JustinVoitel opened this issue Jan 10, 2025 · 0 comments
Open

Missing Flow component for Html element: <code> #20832

JustinVoitel opened this issue Jan 10, 2025 · 0 comments

Comments

@JustinVoitel
Copy link

Describe your motivation

In my flow LitTemplate I want to be able to reference <code> elements via @Id

my-element.ts:

render(){
   html`
      <pre>
         <code id="code"> </code>
      </pre>
   `
}

MyElement.java:

public class MyElement extends LitTemplate {
   @Id
   Code code;
}

Describe the solution you'd like

  1. Extend CODE in the @Tag annotation
public @interface Tag {
   //...

    String CODE = "code";

   //...
}
  1. Add Code.java
@Tag(Tag.CODE)
public class Code extends HtmlContainer implements ClickNotifier<Code> {

    public Code() {
        super();
    }

    public Code(Component... components) {
        super(components);
    }

    public Code(String text) {
        super();
        setText(text);
    }
}
  1. add Element to Table in Documentation

Describe alternatives you've considered

I can reference the existing Pre element and append a new Element("code") element and do the working with the Element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant