Giter Club home page Giter Club logo

dropdown's Introduction

ACTUAL REQUIREMENT IS IN PDF FILE FrontEnd Dropdown take-home.pdf in root directory

Getting Started with Create React App

This project was bootstrapped with Create React App.

To start the project

npm install

Run this command in the command prompt to install all the packages from npm.

Available Scripts

In the project directory, you can run:

npm start

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

The page will reload if you make edits.
You will also see any lint errors in the console.

Implementation

Multiselect and singleselect

Multiselect functionality can be viewed in the route [http://localhost:3000/]. Singleselect functionality can be viewed in the route [http://localhost:3000/singleselect].

Once you click on the open button the dropdown appears with the given countries(options). If you close the button then the dropdown disappears.

On clicking a certain option you can see it gets selected (the word selected is appended to the option). If you click on the option again it gets deselected.

Efficiency

My implementation for efficiently loading large lists is performed via a filter function. The users have an option of searching the required option in the given search box. This makes the process faster in case the user knows what they want to select and thus, making the process efficient.

Search

If an alphabet that is included in the options is typed in the search box then results are displayed accordingly. The search functionality is case sensitive.

To get back to the list of options, clear the search box using the space key.

Debouncing

I am using the concept of debouncing in my search functionality. 500ms post a user stops typing, the search results are returned. This improves browser performance as I am limiting the rate at which the search function is invoked.

The search input box is attached to an event listener that calls the debounce function which searches after 500ms.

Select/ Deselect

I have implemented this functionality by using a button Select/ Deselect. Upon clicking on it, all the options are selected or deselected depending on the previous state of the button.

dropdown's People

Contributors

shaivyt 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.