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

Unstyled DatePicker throws error onKeyDown if input field is empty #6147

Closed
mikahozz opened this issue Jul 30, 2024 · 2 comments
Closed

Unstyled DatePicker throws error onKeyDown if input field is empty #6147

mikahozz opened this issue Jul 30, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@mikahozz
Copy link

Describe the bug

When opening the calendar and clicking an arrow down, DatePicker throws an error:

TypeError: Cannot read properties of undefined (reading 'focus')
    at Proxy.trapFocus (primevue_datepicker.js?v=ecbf9ced:4352:46)
    at Proxy.onKeyDown (primevue_datepicker.js?v=ecbf9ced:4407:14)
    at callWithErrorHandling (chunk-YYVLN2RI.js?v=ecbf9ced:1678:19)
    at callWithAsyncErrorHandling (chunk-YYVLN2RI.js?v=ecbf9ced:1685:17)
    at HTMLInputElement.invoker (chunk-YYVLN2RI.js?v=ecbf9ced:10331:5)

Vue throws a warning with this info:

[Vue warn]: Unhandled error during execution of native event handler 
  at <InputText key=0 ref=fn<bound inputRef> id=null  ... > 
  at <DatePicker unstyled="" showIcon="" iconDisplay="button"  ... > 
  at <App>

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-1kvrox?file=src%2FApp.vue

PrimeVue version

4.0.0-rc.3

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 126, Safari 17

Steps to reproduce the behavior

  1. DatePicker component with unstyled property
  2. Empty input field
  3. Open Calendar with the button
  4. Click arrow down

Expected behavior

Navigating the calendar should work with arrow keys.

@mikahozz mikahozz added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 30, 2024
cjalex1313 added a commit to cjalex1313/primevue that referenced this issue Jul 31, 2024
Fix for primefaces#6147
Pick cell based on attributes not classes via selector
@cjalex1313
Copy link
Contributor

I created this #6155 as a fix

tugcekucukoglu added a commit that referenced this issue Aug 1, 2024
@mikahozz
Copy link
Author

mikahozz commented Aug 5, 2024

This seems to work now, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants