F0rce/ace

Adding a label element inside a component. AceEditor.setLabel()

Flekon opened this issue · 2 comments

Flekon commented

Hello, we really like your component and it works great in our project!

Faced a problem adding the label for the editor.
We would like to be able to add a label inside the component, so as not to create a wrapper div with a label and an editor inside.

Vaadin's core components implement the HasLabel interface with default getLabel()/setLabel() methods.
We tried to use this interface to extend the methods of the AceEditor class, but it did not work. It looks like it needs some extra interaction with the label property on the client side.

We are currently using version 2.3.1 for vaadin 14.

Thanks in advance for your response!

F0rce commented

Hi @Flekon :)

First of all thanks for the feedback, I really appreciate it.

Unfortunately I don't have the time to focus on my open source Vaadin components. Especially the version v2.3.1 with Vaadin 14 has no use case anymore and has not been updated for a long time (while v3.x has got some updates over the time).

As for your feature request, I don't think it's that easy/simple to add a label inside the editor div. I'd have to add functionality to lit-ace (the pure frontend part) to add a slot that can be accessed by the Java backend.

I think the best "workaround" would be to use a wrapper div that adds the label (as far as I know, this is what I do).

But if you want, you could create an implementation that I could merge for the v2.x version of the component.

Have a great week 💯

Flekon commented

Thanks a lot for your quick reply!
We solved the issue by simply wrapping the component in a container with a label when the editor's attach event fires.

In any case, we are very grateful for the excellent implementation of the component and the quick feedback!