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: Row and Checkbox Selection causes event bubbling and disables cell text copying #2505

Closed
m-ivanova opened this issue Dec 9, 2021 · 5 comments

Comments

@m-ivanova
Copy link

When the selection option "Checkbox-Only Selection" is used in the datatable, I am unable to copy the text from the cells in the table and also when triggering the onRowClick event from the datatable the checkbox gets focused. I do believe that maybe in the background the row itself gets selected that causes problems related to event bubbling as well.

I'm submitting a ... (check one with "x")

[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)
Please fork the codesandbox below and create a case demonstrating your bug report. Issues without a codesandbox have much less possibility to be reviewed.

PLEASE USE THE Example given in the Primereact DEMO Examples.
https://www.primefaces.org/primereact/showcase/#/datatable/selection

Scroll to Row and Checkbox Selection

Current behavior
Use "Checkbox-Only Selection" in the Datatable component and try to click on the row(for example to copy the text from on of the cells), the checkbox gets focused. When trying to remove the selection from the table, the issue does not exist.

Expected behavior
To remove the focus from the checkbox and maybe remove selecting the row in the background(if this is what is happening)

Minimal reproduction of the problem with instructions
Steps are described above in "Current behaviour"

Please tell us about your environment:
Windows,Visual Studio Code, npm

  • React version:
    17.0.1

  • PrimeReact version:
    6.4.1

  • Browser: Firefox

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

@mertsincan
Copy link
Member

Hi,

I couldn't replicate this issue. Could you please attach a video or gif for us?

Best Regards,

@mertsincan mertsincan added the Resolution: Cannot Replicate Issue could not be replicated by Core Team label Dec 13, 2021
@m-ivanova
Copy link
Author

Hi,

attach you will find the recording. I am using Firefox and the demo components from your page.
https://user-images.githubusercontent.com/35693852/145977799-06a437fa-8d77-4f96-a270-32e95e1894df.mp4

@mertsincan
Copy link
Member

Hi,

Thanks a lot for the video! Did you try it with Chrome? Maybe, this issue can be related to FF.

@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Resolution: Cannot Replicate Issue could not be replicated by Core Team labels Dec 14, 2021
@m-ivanova
Copy link
Author

Hello,

I did try, but I need this to be working in Firefox as well.
And whenever I have a horizontal scroll in the datatable I am unable to copy the text whenever the scroll is not at the beginning of the table, because the checkbox gets focused and it is positioned in the beginning of the table.
The conclusion that the issue comes from the checkbox selection came from the fact that whenever I remove the selection from the table , all works as intended.

@mertsincan
Copy link
Member

Fixed in #2575

Please try selectionAutoFocus={false} on 7.1.1

Best Regards,

@mertsincan mertsincan removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants