Row doesn't get selected when we click on the action buttons in a table row

Hello, @victoria !

I'm having a different issue on my side. The row is selected only after a double-click or after I click on it once and then click on a different row, then the previously clicked row is selected.

Here are my settings:

Thanks!

I have a table inside a tabbed Container with 3 rows:

Row 1: Regina, Row 2: Luis, Row 3: Enrico.

I clicked on action button of Enrico's row:

The table has a event Row select change that set temporary state with {{table.selectedRow.data}}:

Last, the action button "Ver detalhes" has a query that opens a new app with the temporary state as parameter.

The page received the second row (Luis) data as parameter, instead of Enrico.

Note that we activated Select row on click:

.

This functionality was working before, could you please check what happened?

Thank you both for sharing so many details, @kaduh5589 and @luismiguel!

@kaduh5589 it seems like selecting rows is working for me actually :thinking: What version of cloud are you currently on?

@luismiguel, perfect. I was able to repro this (action button firing before the select row event handler) and shared it with the engineers that fixed this last week. I'll keep you updated on next steps!

1 Like

Hello, @victoria !

I'm on 2.91.1.

The table is currently inside a module and also inside a container, and it has 2 action buttons on it.

But... I just tried to CTRL+C -> CTRL+V the table inside the same container and the pasted version is working normally. The copied version still has the same problem, but the duplicated one doesn't.

I have no idea what caused the issue as I tried everything to fix it, from changing all settings to removing the actions buttons and so on, and nothing worked. The solution in the end was to just duplicate the table and use the new one instead, which doesn't have the issue on it. Quite strange, but it's solved now at least.

Thanks, @victoria !

1 Like

Actually, I partially take that back. :sweat_smile:

I believe I found a way to reproduce it.

At least for me, what's breaking the table is to change the "Default row" setting to "None" and then refresh the page once (this step is necessary).

After that, the row selection issue starts to happen and sometimes even the table does not load data properly while in Preview mode (in edit mode the row issue happens but not the empty data one):

After the table is broken, it cannot be fixed. The only way to correct the problem is to change the setting back to "First" or "Index" and then duplicate the table component by CTRL+C -> CTRL+V it, and also never touch the "Default row" setting anymore.

Quite a strange issue.

I hope that info helps!

Ooh, interesting! I haven't been able to reproduce this just yet.

So

table > change "Default row" to "none" > refresh > try in both edit and preview modes

is that correct?

Hello, @victoria !

Yes, that was the scenario I thought would reproduce it but I just found out that it was just a coincidence.

Basically, after I copy and paste the table, it works until I change the name of the new table to the same name of the old one I deleted, which is mentioned/used in several scripts and fields. Once I change its name, it basically connects with all elements that reference the table and the issue starts to happen.

I re-created the table from zero trying to understand where exactly the issue started happening and it's definitely related on other components referencing the table's data, just not sure which one exactly.

For example, I have multiple elements that depend on the table.selectedRow to show info or perform some actions. When I change the name of the new table to the name of the other table which is referenced in other components/scripts/transformers/etc., after a page refresh the issue starts happening. I have no idea which element is causing that, unfortunately. I'll try testing it further removing reference by reference until I find the exact one which might be causing the problem. I don't have any "onSelect" or "onChange" action set up on the table or elsewhere, so in theory it must be some kind of selectedRow reference.

With that said, I believe the only way to reproduce this possible bug on Retool's side right now would be to test the exact same app I have here. Should I try to start a conversation with the support team to send a copy of my app there?

In case I find the exact reference that is causing the problem, I'll let you know here as well.

Thanks!

Found it!

It was caused by a listView configuration, which was located inside a modal opened by a click on one of the actions of the table.

It was one very specific field, which turns out is actually unnecessary for the list view to work.

This was the guilty field:

I removed it and it's working normally now again.

Not sure if removing it may cause some unintentioned issue but it seems to be working fine.

In case it's a bug and not some mistake done by me, I hope that helps you to reproduce the issue!

This bug is back again.

Hey @Rory! Ack. Is it the exact same bug with an action button referenced selectedRow?