-
-
Notifications
You must be signed in to change notification settings - Fork 475
Closed
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Steps to reproduce
- Create new
vite react-ts project - install
flowbite-react@0.7.7(was also occurring with previous versions of 0.7.x) - Replace
App.tsxcontents withCode Exampleat the end. - Run project
- Open web console for output
- Select dropdown
- Put cursor header text box
- attempt typing
- Key press down/up log out, on change doesn't with little exception (space, backspace, etc. do work)
- Pasting a value into the input properly fires off the controls
onChangehandler - Pressing a key that represents the First Character of an item in the list, jumps to that item in the list, removing you from the control.
Current behavior
-
You will see the Key pressed value for
onKeyDownandonKeyUpbut you will never see any output foronChange. It appears theonChangehandler is being hijacked somewhere an not being called as a result. -
Non-AlphaNumeric keys seem to properly "act" in the field. (space, backspace, arrows move the cursor as expected)
-
Pasting a value into the field triggers
onChangeproperly. -
Other
flowbite-reactcontrols such asTabs,ToggleSwitch,Checkbox, etc., behave as expected. -
Attempting to type a the first character of one of the drop down values (in this case i) will jump you to a row starting with that character.
Expected behavior
- The expectation is the
inputandTextInputcontrols would behave as normal. And I would be able to prevent the automatic search of items in the dropdown.
Context
Code Example
import './App.css';
import { Dropdown } from 'flowbite-react';
function App() {
return (
<>
<Dropdown label="hello">
<Dropdown.Header>
<div className="p-3">
<div className="relative">
<input
className="w-full"
onChange={(e) => console.log(e?.target.value)}
onKeyDown={(e) => console.log(e?.key)}
onKeyUp={(e) => console.log(e?.key)}
/>
</div>
</div>
</Dropdown.Header>
<Dropdown.Item>item0</Dropdown.Item>
<Dropdown.Item>item1</Dropdown.Item>
<Dropdown.Item>item2</Dropdown.Item>
</Dropdown>
</>
);
}
export default App;Metadata
Metadata
Assignees
Labels
No labels