npm.io
1.0.0 • Published 10 years ago

select-hook

Licence
MIT
Version
1.0.0
Deps
3
Vulns
0
Weekly
0
Stars
1

select-hook Build Status

virtual-dom hook for setting text selection

Install

$ npm install --save select-hook

Usage

var h = require('virtual-dom/h')
var SelectHook = require('select-hook')

function render (state) {
  return h('input', {
    select: SelectHook({
      start: 0,
      end: 10
    })
  })
}

API

SelectHook([options]) -> object
options

Type: object
Default: {start: 0, end: 0}

An object containing the start and end points of the desired selection.

License

MIT Ben Drucker

Keywords