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

ListBox fails on tap item in mobile #2000

Closed
yosbelms opened this issue May 1, 2021 · 1 comment
Closed

ListBox fails on tap item in mobile #2000

yosbelms opened this issue May 1, 2021 · 1 comment
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@yosbelms
Copy link

yosbelms commented May 1, 2021

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

Current behavior
onOptionTouchEnd fails with error message:

Uncaught TypeError: Cannot read property 'disabled' of undefined

Expected behavior
Should not fail

Minimal reproduction of the problem with instructions
Tested on Chrome
1 - Point the browser to https://www.primefaces.org/primereact/showcase/#/listbox
2 - Show development tools (Chrome)
3 - Click in the tool used to display the page in different devices screen
4 - Click any item on the list, and check the console to see the error

The issue:
The onOptionTouchEnd is being passed to ListBoxItem without binding to the ListBox instance, see the links below:

onClick={this.onOptionSelect} onTouchEnd={this.onOptionTouchEnd} tabIndex={tabIndex} disabled={disabled} />

onClick={this.onOptionSelect} onTouchEnd={this.onOptionTouchEnd} tabIndex={tabIndex} disabled={disabled} />

  • React version:
    16

  • PrimeReact version:
    6.3

  • Browser:
    Chrome

  • Language:
    TypeScript

@mertsincan mertsincan self-assigned this May 1, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label May 1, 2021
@mertsincan mertsincan added this to the 6.3.2 milestone May 1, 2021
@mertsincan
Copy link
Member

Thanks a lot for your report!

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants