Code Monkey home page Code Monkey logo

typeaheadcomponent's Introduction

Submitting instructions:

In order to run and use the project you will need Node, and npm in your computer. Then follow the instructions:

  • Clone the Repo
  • CD into the repo and run npm install
  • Run npm start and you will see the app in http://localhost:3000
  • In order to run the E2E test: npm cypress:run

Project Instructions / Requirements

  • This app is currently in a broken state. You must create your component and add it to ReactDOM.render in src/index.js to get started.
  • Using React and CSS, create a Typeahead component that takes a list prop.
  • Use the colorsList list defined in src/index.js as the value for the list prop.
    • Please do not change colorsList or its contents.
    • If you want to go above and beyond, you can add other features or use another list that you receive from an async query, as long as it still meets all the same requirements when the colorsList is passed as the list prop.

Submitting instructions:

In order to run and use the project you will need Node, and npm in your computer. Then follow the instructions:

  • Clone the Repo
  • CD into the repo and run npm install
  • Run npm start and you will see the app in http://localhost:3000
  • In order to run the E2E test: npm cypress:run

Submitting your Project

  • Send the link to a public repository with your project submission to your recruitment contact.

Things we like to see

  • Use of propTypes and/or other typing systems
  • Responsive design
  • Tasteful styling
  • Tasteful animations are a bonus

Things we hope not to see

  • Use of styling frameworks (Material, Bootstrap, Tailwind, etc.)
    • Styling writing libraries and pre-processors (Styled Components, SCSS, etc) are welcome but not expected.
  • Copy/Pasted code from other source code

Requirements

  1. As the user types in the input field, a list of options should appear below it.
    • The list should only appear when input is not empty. Whitespace is considered empty.
    • The list should contain items from the list prop that start with the user entered value. Matching should be case insensitive. Every new character typed should filter the list.
  2. Clicking on a list item should populate the input with the selected item's value and hide the list.
  3. As the user types, the matching substring within the dipslayed options should be bold. The rest of the string should not be bold.
    1. Ex. When the user types bl, bl in black, blanchedalmond, blue, and blueviolet should be bold. The rest of each word should not be bold.
  4. For visible options, style the substring the user has entered as bold.
  5. Mousing over a list item should highlight it, at least darkening its background color. Other styling is up to you.
  6. The input and list should also be navigable using the keyboard.
    • Using tab and shift+tab, the user should be able to move focus to and from the different list items.
      • With the cursor in the input, pressing the tab key should move focus to the first item with the default browser focus style.
      • Subsequent presses of the "tab" key should focus the next item in the list.
      • Pressing the shift+tab keys should focus the previous item in the list.
      • Pressing the shift+tab key when the first item is focused should focus the input again.
      • Mousing over other list items should highlight them while the keyboard- focused item remains focused.
      • Pressing the tab key when no list is visible should move focus away from the input.
    • Pressing the enter or return key when an item is focused should populate the input with the focused item's value, hide the list, and focus the input again.
    • Pressing the escape key should close the list.
  7. Clicking outside the input or the list should close the list.

Development Instructions

  1. Clone this repository and run npm install to install dependencies.
  2. From the project directory, npm start runs the app in development mode.
  3. Open http://localhost:3000 to view it in the browser.
Attributions

This project was bootstrapped with Create React App.

typeaheadcomponent's People

Contributors

jamie29w avatar

Watchers

James Cloos avatar  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.