The :active pesudo-class only applies to button element

:active pseudo class only applies to button.
In the web, The :active can be applied to div. But in UITK that doesn’t work for VisualElement

You can add :active pseudo class support by adding a Clickable manipulator to your element.

EDIT
Here you can find more info on manipulators.

1 Like

EDITED
Did you mean to write a Clickable manipulator that simulates :active by adding an active class? I think the official documentation does not clearly state that :active only supports Button, so this should be a bug

Yes, I mean that code. That’s basically it. There’s also a clickedWithEventInfo event that you can use if you need info from the mouse event. And you can use the activators property to change what kinds of clicks you want to react to.

Alternatively, you can use a custom USS class instead of “active”.

Hey, I’m just trying to help you. I’m not responsible for how it works. My guess is that it’s been deemed not to be worth the time it’d need to work well and fast enough.

1 Like

Thx. I mean, I think this is a bug because this situation is not clearly stated in the official documentation, and I also think that the :active pseudo-class should support all VisualElements to better fit the Web, nothing else mean