How to implement float labels on NativeScript?


#1

I used this tutorial to build my forms with css in Vue https://css-tricks.com/float-labels-css/

I’d like to make it work on NativeScript, but the pseudo-selectors :valid and :focus aren’t supported. How can I make float labels work in NativeScript?


#2

You can wrap the text field and label inside a layout, show and hide the label with animation when textfield is focused / blurred.


#3

What is the selector for textfield in focus?


#4

You can’t do that with CSS, use the events.


#5

Thank you for your answers!