0

I have two textAreas. For 1st one I want to make labels align row center, for the 2nd column flew-start. I give for every of them own Id and created separate html files for each. But when 1st textarea changes the 2nd one changes like the 1st, I can't give them their own label align.

How can I give for each own label alignment ?

AS Mackay
  • 2,831
  • 9
  • 19
  • 25
Champ
  • 51
  • 1
  • 7
  • 1
    Please add the relevant code to your question. – Steffen Harbich Mar 17 '19 at 19:33
  • I have two classes: First.java and Second.java. Also have two html files first.html for First.java, second.html for Second.java. In every class i have textarea. For the 1st textarea i want to set its label alignment left, for the 2nd alignment right. But when i run project 1st textrea's label aligns right too not left. How to fix it? – Champ Mar 18 '19 at 07:16

1 Answers1

1

You probably need to use textArea1.addClassName("my-text-area1") and then use something like follows:

<dom-module theme-for="vaadin-text-area" id="style-for-text-area1">
    <template>
        <style>
            :host(.my-text-area1) [part="label"]{
                ... styles here ...
            }
        </style>
    </template>
</dom-module>

And then do the same for the other text area.

Tatu Lund
  • 9,949
  • 1
  • 12
  • 26
  • But how to use flex-direction in this case? For the 1st I want flex-direction:column; for the 2nd flex-direction:row? It works only for all textareas not for each separately. – Champ Mar 18 '19 at 15:16