Skip to content

An range-selector for checkboxes. Simply shift+click from point A to B.

License

Notifications You must be signed in to change notification settings

TobiasBulai/shift-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shift Selector

This project aims to help and enable shift+click on checkboxes, like how some E-mail applications do to help us handle more than one issue at a time.

How to use

Simply click on the first checkbox, then on the second shift+click to select the span up until that point.

If a checkbox is de-selected and you perform the shift+click, you then de-select the items in that span too!

Enable in project

The project features a module ready function that you can simply import to your project:

import shiftSelect from 'shift-select'

// I'm now enabled on this page!
shiftSelect()

// I'm now enabled on a specific element!
shiftSelect(document.getElementById('myForm'))

Or if you have a simple page without Node or similar environment, just remove the export default from the index.js-file and use it on your page:

<body>
  <form id="myForm">
    <input type="checkbox"> Some box
    <input type="checkbox"> Some box2
  </form>
  <script src="index.js"></script>
  <script>
    shiftSelect()
  </script>
</body>

About

An range-selector for checkboxes. Simply shift+click from point A to B.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published