nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Accordion prevents <Input/> or <Textarea/> children from working correctly

Open samosaboy opened this issue 3 years ago • 4 comments

NextUI Version

2.1.12

Describe the bug

When using <Accordion> and <AccordionItem>, if the nested children are of <Input /> or <Textarea /> type, their input commands are not registered. For example, you are unable to use the "Spacebar" key and most punctuations.

Your Example Website or App

https://codesandbox.io/s/morning-firefly-yscnvz?file=/src/App.js

Steps to Reproduce the Bug or Issue

  1. Use the base accordion example
  2. Add a text area using the Textarea example
  3. Observe that punctuations, spacebar and at times regularly input is not registered correctly

Expected behavior

As a user, I expect input and textarea to function regularly and as expected when inside the accordion.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Opera

samosaboy avatar Sep 11 '23 20:09 samosaboy

Fixed, install the latest version v2.1.13

jrgarciadev avatar Sep 16 '23 21:09 jrgarciadev

@jrgarciadev The same problem still happens for @nextui-org/table (current version - 2.0.28). A normal HTML <input/> or <textarea/> element in a <TableCell/> has problem entering the space bar. Sometimes the spacebar works, sometimes it doesn't. Can you please check? Thanks a lot!

yewyewxd avatar Nov 15 '23 00:11 yewyewxd

It seems we are not able to use Arrows Keys (Up and Down) when using TextArea inside an Accordion.

I forked @samosaboy sandbox and upgraded to lastest NextUI version. sanbbox

Please enter at least two lines in a Textarea to test. And the same applies to any other control inside an Accordion, in my case I was using TipTap.

alfredoPacheco avatar Dec 04 '23 21:12 alfredoPacheco

I am temporarily doing this as a workaround:

<AccordionItem
            key={item.$id}
            ...
            onKeyDown={e => e.stopPropagation()}
          >
            ...

alfredoPacheco avatar Dec 05 '23 03:12 alfredoPacheco