primeng icon indicating copy to clipboard operation
primeng copied to clipboard

ListBox: preventDefault on list items causes undesired behavior

Open ahaller-billtrust opened this issue 1 year ago • 1 comments

Describe the bug

I have a ListBox with items that contain inputs: image After upgrading to PrimeNg 17, I noticed that those inputs on the listbox items become unusable. Debugging the PrimeNg source code, I found that you added a preventDefault to the listbox <ul> element on the (keydown) event.

  • https://github.com/primefaces/primeng/blob/17.18.9/src/app/components/listbox/listbox.ts#L153
  • https://github.com/primefaces/primeng/blob/17.18.9/src/app/components/listbox/listbox.ts#L1072

This is the root cause of my issue.

Environment

Windows, Chrome browser

Reproducer

https://stackblitz.com/edit/qtf5t1?file=src%2Fapp%2Flistbox-template-demo.html

Angular version

18.2.2

PrimeNG version

17.18.9

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.4

Browser(s)

Chrome 127

Steps to reproduce the behavior

Add inputs to ListBox items Try to type on those inputs (keydown events will be prevented)

Expected behavior

I should be able to type on inputs inside ListBox items

ahaller-billtrust avatar Sep 02 '24 20:09 ahaller-billtrust

any updates?

ahaller-billtrust avatar Sep 06 '24 14:09 ahaller-billtrust

I am also seeing this issue.

epaitz avatar Oct 03 '24 00:10 epaitz

Any updates on this one?

FelipeRLB avatar Mar 24 '25 23:03 FelipeRLB

@mertsincan

This is starting to be a problem. It's been broken for all of v18 and possibly v17. Is there a fix in the works for v19 anytime soon?

epaitz avatar Apr 10 '25 11:04 epaitz

@cagataycivici

Would it be possible to assign this issue to someone else?

epaitz avatar Apr 18 '25 12:04 epaitz