Only some DVL components respond to clicks

Is there some workaround or fix for the fact that when I click on some of the components in a custom DVL (data viewer list) layout, they don’t respond?

I’m creating a pop-up menu like this:

image

The layout is a container containing from left to right: an image, a label, and a button. If I preview it and click on the label, it registers the click event with this block:

But if I click on the image or button, it does not.

I’ve created a bug report here: Clicking any component in a custom data viewer layout should trigger an item click event · Issue #1264 · thunkable/thunkable-issues · GitHub

1 Like

I’ve also tried cloning a group to create a pop-up menu and although I can determine which group (row in the menu) was clicked, it doesn’t work reliably for the same reason… components in the group prevent clicks from “going through” to the group and therefore are not detected consistently.

1 Like

That is true if the group is behind the components. However, if you place a pseudo group on top of the components then it will be the one receiving the click.

I thought of that as well. I guess I don’t know how to do that. I don’t see a way to layer groups. Do you have an example of that in DnD?

1 Like

The trick is in the component tree the component that will receive the click is the higher component in the tree.

Just make sure the label or the group is higher in the component tree from those component beneath it in the screen.

I was able to get it to work with stacked Groups. Thank you for that suggestion! I don’t know why I had such a problem figuring out how to do that before. I guess a good night’s sleep helped! :slight_smile:

What I ended up doing is creating a group containing an image, label and button and then an empty group which I placed on top of that group on the screen but above it in the component tree. I clone both groups where I need them and then use Any Component blocks to determine which group was clicked:

1 Like

I’d still like to be able to do the same with a DVL…

1 Like

It should be the same with DVL but if you are using the StP editor then you need to use fixed position components and you need to access the advanced properties and set the z-index to a high number to be on top of other components in the row/column.

No, I’m using DnD. So I don’t see a way to layer Containers within a Layout. That is, I can’t see a way to drag one container on top of the other within the layout screen. I don’t mean the component tree.

1 Like

You’re right. This option is not available in the Layout component in DnD. I tried to add buttons on top of each other in the container but there is no property to do that.

However, If you start with a Group outside of the container and layout and have the components inside the group stacked on top of each other then drag the group into the container you will notice that the design will show that the components inside the group has been rearranged to fit the style of the container BUT when you test it (I tried web test only) the components inside the group will show in the screen the way they were positioned in the group before being dragged in the container.

I guess this is a bug so you can’t rely on it as a solution.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.