1.1.0 • Published 8 years ago

select-all-hook v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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