🤖 Autocomplete-API-Input-React-Redux
The project is a recruitment task, it is using technologies and doing tasks as:
- For user interface JavaScript with React JS
- For global state management Redux / React-Redux / Redux-Thunk
- For asynchronous fetching data axios
- For handling suggestions:
- OnChange
- OnClick
- KeyDown for keyboard handling
- Basic CSS styling
-
Axios is downloading all users when component is mounted and is adding only user names Redux global state.
-
Input is listening at 'onChange' method and checking with Regular Expression which letters starting from right are matching with user names stored in redux store.
-
Additional method "handleSuggestions" is filtering which user names are matching and all of them are displayed just below the input.
-
We can choose from suggestions using mouse - hover is showing which one is currently hovered.
-
We can also use keyboard "keyDown" method to navigate through suggestions and approve by ENTER button or exit by ESC button.