Semantic-Org / Semantic-UI-React

The official Semantic-UI-React integration
https://react.semantic-ui.com
MIT License
13.21k stars 4.05k forks source link

Spacebar is not working in the example of 'Dropdown in Menu' #4374

Open fireHedgehog opened 2 years ago

fireHedgehog commented 2 years ago

Bug Report

1658282138648

According to the screenshot, the spacebar is not working in the INPUT component.

Steps

Step 1: Open the dropdown component. Step 2: Type the things you want to search at the Input componenet. Step 3: Press spacebar.

Expected Result

There should be some spaces between words.

Actual Result

Nothing happened when press the spacebar 💣

Version

2.1.3

Testcase

[semantic-ui official website example]:

Thank you very much.

welcome[bot] commented 2 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

arjitacharya1994 commented 2 years ago

try this @fireHedgehog -

<Input
                icon={<Icon name="search" inverted />}
                placeholder="Search.."
                onClick={this.onInputClick}
                onKeyDown={(e) => {
                  e.code === 'Space' ? e.stopPropagation() : null;
                }}
   />
tabed10 commented 1 year ago

Thanks @arjitacharya1994 this helped. @fireHedgehog if you are using input tags in Menu, try using this field in input:

<input
   ...
   onKeyDown={(e: any) => {e.code === 'Space' && e.stopPropagation()}}
   ...
/>