Accessing click target in event handler

Hi Retool team

Is it possible to access the click event's data in an event handler?

My case:

  • I've created a table with some clickable content (links in cells)
  • I would like to have an additional behaviour (navigation) when user clicks on an entire row (but not when user targets a clickable link)
  • I figured the best way would be to add a row-click event handler and in it check the event.target and then conditionally navigate.

It depends on where you are trying to navigate? A new tab? Somewhere else?

I recommend the navigation behavior to be triggered when double-clicked the row, so user cannot navigate accidentally when clicking the link.

Or you can set Cell selection property to "Single" and set an event handler on Click cell and set the "only run when" to:

{{ !tableId.selectedCell.value.includes("https://") }}

We do have a custom logic for navigation. At the end of the day I need to run a custom script conditionally.

I think this might be a good example.

the "Test721" is a link. When user clicks the link - they should be navigated to linked Test721, if they click on the cell (but not the link they should be navigated on the row level (to entity represented by the row))