Click method for every clickable component

Hello devs
if possible then it will be great to add click method for every clickable component like label image and arrangement

component_method

benefits :-

  • if we want to click an arrangement which have a label inside then we need to set .click event for both but if we have .click method then it can be done easily with less blocks. it will save our time also

Kindly share some benefits of it with us.

2 Likes

wait i will edit first post
edited

1 Like

You can connect a procedure block to available click events inside which you can place all your click logic. Simulating the click is as easy as calling the procedure wherever you want

4 Likes

I think this is possible by Procedures

2 Likes

Yes… But there is image method for buttons, then why not the labels, images, cards and arrangements. They are also clickable now.

Writing a procedure and calling that procedure for every click event is currently the only option available for components other than a button. Having this method available will be handy.

3 Likes

So before I put my thoughts here, I would like to ask a simple question to everyone.
Are both different?
1.
image

image

Fun fact: The second method saves 2 blocks.

1 Like

No

Hope you have got your answer. :slightly_smiling_face:

But i want it for different work

How you want to use it?
An example please.

I have created a simple manual list using horizontal arrangements. A lable is inside every arrangement. But when user clicks on lable nothing happens. To set onclick event for every lable will be consist lot of blocks

1 Like

Then use the click event of HA.

Yes i want to do this
when lable1.click call horizontal arrangement 1.click

Move Label Click blocks to HA’s click event.

Or it will be great if horizontal arrangement have full clickable block like card view

Hmmm… I don’t understand why

1 Like

Enable card property.

2 Likes

Exactly i also has faced this issue

Also set card view elevation to 0.

1 Like