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: select-on-focus causes a crash #4881

Closed
Daniel-WWU-IT opened this issue Nov 27, 2023 · 0 comments
Closed

Listbox: select-on-focus causes a crash #4881

Daniel-WWU-IT opened this issue Nov 27, 2023 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Daniel-WWU-IT
Copy link

Daniel-WWU-IT commented Nov 27, 2023

Describe the bug

In version 3.41.1, an issue seems to have been introduced in the Listbox component: If the select-on-focus option is set, a crash occurs, even for an empty list (<Listbox :options="[]" select-on-focus /> sufficies to get the error). In 3.41.0, this would work fine.

This is the error thrown:

listbox.esm.js:294 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'metaKey')
    at Proxy.onOptionSelectSingle (listbox.esm.js:294:29)
    at Proxy.onOptionSelect (listbox.esm.js:270:73)
    at Proxy.autoUpdateModel (listbox.esm.js:606:14)
    at Proxy.mounted2 (listbox.esm.js:139:10)
    at runtime-core.esm-bundler.js:2756:88
    at callWithErrorHandling (runtime-core.esm-bundler.js:158:18)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:17)
    at hook.__weh.hook.__weh (runtime-core.esm-bundler.js:2736:19)
    at flushPostFlushCbs (runtime-core.esm-bundler.js:330:40)
    at flushJobs (runtime-core.esm-bundler.js:368:5)

A bit of debugging showed that onOptionSelectSingle is called w/o any arguments, i.e. the event parameter is actually undefined.

Reproducer

Full project

Sorry, right now there's no time for a separate reproducer. This is the full project the bug occurred in.

PrimeVue version

3.41.1

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Even this simple listbox will crash:
<Listbox :options="[]" select-on-focus />

Expected behavior

Not crashing...

@Daniel-WWU-IT Daniel-WWU-IT added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 27, 2023
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 27, 2023
@tugcekucukoglu tugcekucukoglu added this to the 3.42.0 milestone Nov 27, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants