Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: Clicking the center mouse button on a row should open the row item in a new tab #5051

Closed
tonoy30 opened this issue Oct 6, 2023 · 4 comments · Fixed by #5057
Closed
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@tonoy30
Copy link

tonoy30 commented Oct 6, 2023

Describe the feature you would like to see added

I would like to see a feature where, upon clicking the center mouse button on a specific row item within a data table, that item opens in a new tab. Essentially, I aim to replicate the behavior of a hyperlink when the mouse's center button is clicked.

Is your feature request related to a problem?

I'm not able to capture the center mouse button click on onRowClick event handler

Describe the solution you'd like

Capturing the center mouse button click (often referred to as the middle mouse button click) in a standard onRowClick event handler is challenging because it's not a standard event that all browsers and systems support and it's not being captured by the onRowClick event handler. The middle mouse button is often used for various system functions, and it might not be consistently recognized as a standard click event in web applications.

So, I would like to see an additional props for auxclick event which is designed to capture clicks from auxiliary input devices like the middle mouse button.

Describe alternatives you have considered

No response

Additional context

No response

@tonoy30 tonoy30 added Status: Discussion Issue or pull request needs to be discussed by Core Team Type: New Feature Issue contains a new feature or new component request labels Oct 6, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 6, 2023
@melloware
Copy link
Member

Reproducer showing the issue: https://stackblitz.com/edit/react-uhtkkm?file=src%2FApp.js

@paustint
Copy link
Contributor

paustint commented Oct 6, 2023

@tonoy30 @melloware - What about using onPointerDown? Looks like this one includes the button that was clicked.

image

@tonoy30
Copy link
Author

tonoy30 commented Oct 6, 2023

@paustint I also need the data of the clicked row on the event handler. onPointerDown, onMouseDown and onAuxClick can capture the center mouse button click event but I they don't have of row data like the onRowClick does.

@melloware
Copy link
Member

onPointerDown is probably the most correct one to use.

@melloware melloware removed Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 6, 2023
paustint added a commit to paustint/primereact that referenced this issue Oct 7, 2023
In order for users to be able to simulate row clicks as html links
the center mouse button needs to be able to be listed for
along with the row that was clicked

resolves primefaces#5051
@melloware melloware added this to the 10.0.3 milestone Oct 7, 2023
melloware pushed a commit that referenced this issue Oct 7, 2023
In order for users to be able to simulate row clicks as html links
the center mouse button needs to be able to be listed for
along with the row that was clicked

resolves #5051
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants