Coder Social home page Coder Social logo

fuzzy-search-input's Introduction

Fuzzy Search input

This input fuzzy search or autocompletes search results. The data comes from JSON file of fruits in this repo src/constants/fruits.JSON

Screenshot 2022-07-09 at 11 26 47 AM


Screenshot 2022-07-09 at 11 25 02 AM


Screenshot 2022-07-09 at 11 24 42 AM


Screenshots

Steps to run

yarn or npm install

Download dependencies

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

yarn test

To run unit tests

Criteria

Functional requirements:

  1. It must be built in React; feel free to use a styling solution of your choice
  2. Upon typing, the widget fuzzy-matches case-insensitively against the list at the end of this document and presents list items that contain the matched characters as suggestions
  3. Clicking an autocomplete suggestion should fill in the input with the full text
  4. Using the up and down arrow keys should allow the user to highlight a desired suggestion and press Enter to select it, filling in the input
  5. The input should be a valid HTML text input element to be used in a standard HTML form setup
  6. The user should be able to proceed without choosing one of the suggestions (non-exclusive)

Styling requirements:

  1. The widget match suggestions should appear below the text input as a floating container
  2. The floating suggestion area should become scrollable when there are many suggestions
  3. The matched portion of the suggestion should be highlighted in some way

Misc comments

this is the result of developing a fuzzy search input in a 3 hour code sprint. If I had more time I would have made more integration tests to assert the flow of keypress and UI validation, as well as give the styling some more TLC to really make it ✨sparkle✨. I decided to use useEventListener hook as dependable interface handle key events.

fuzzy-search-input's People

Contributors

colinrosati avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.