npm.io
1.1.0 • Published 10 years ago

select-all-hook

Licence
MIT
Version
1.1.0
Deps
1
Vulns
0
Weekly
0

select-all-hook Build Status

virtual-dom hook for selecting all text in an element

Install

$ npm install --save select-all-hook

Usage

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

function render (state) {
  return h('input', {
    select: SelectAllHook()
  })
}

API

SelectAllHook([predicate]) -> object

Creates a virtual-dom hook that will select all text in the target element.

predicate

Type: function

An optional function predicate. If provided, the hook will only be applied when the predicate evaluates to truthy.

License

MIT Ben Drucker

Keywords