trimble-oss / modus-web-components

This library provides Modus components as web components - reusable, encapsulated UI elements that are framework agnostic (can be implemented in any site).
https://modus-web-components.trimble.com/
MIT License
30 stars 65 forks source link

Table: add row click event #2480

Open leosole-trimble opened 1 month ago

leosole-trimble commented 1 month ago

Prerequisites

Proposal

Emit a row click event when the user clicks a row (if the cell clicked is not editable)

Motivation and context

We need a way to direct the user to a detail page when clicking the row. Right now this is only possible through the icons at the end of the row, and our designers would like to have the click in the whole row, so we wouldn't need the extra column.

What is the issue regarding ?

@trimble-oss/modus-web-components

Priority

High

What product/project are you using Modus Components for ?

Trimble Inspections

What is your team/division name ?

Camaleão/Transportation

Are you willing to contribute ?

Yes

Are you using Modus Web Components in production ?

no

github-actions[bot] commented 1 month ago

Hello @leosole-trimble! Thanks for opening an issue. The Modus core team will get back to you soon (usually within 24-hours) and provide guidance on how to proceed. Contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to.

Please wait until the issue is ready to be worked on before submitting a PR, or you can reach out to the core team if it is time bound. For trivial things, or bugs that don't change the expected behaviors and UI, you can go ahead and make a PR.

enowak1031 commented 1 month ago

@cjwinsor Let's look at this one tomorrow during standup.

cjwinsor commented 1 month ago

@leosole-trimble Can you provide your Motivation and context so we can better ensure that any changes we make to support this event meet your needs?

Did you need any visual indication that a row has been focused after the click, or expecting any other visual indications? You mention that it won't fire the event if the cell is editable, but what if some other cells are?

leosole-trimble commented 1 month ago

@cjwinsor sure. We do not need visual indicators after the click. Since there's already an option for highlighting the row on hover, an option to change the cursor to a pointer would be enough (not sure if it's already possible). Our use case do not use editable cells, I just mentioned it because it could cause issues in other possible uses.

leosole-trimble commented 1 month ago

I thought of just emitting the click if the cell clicked is not editable