knockout-select-on-focus

0.1.5 • Public • Published

knockout.selectOnFocus

This binding selects the text in a input field or a textarea when the field get focused.

Click here to see an example

Install

NPM

npm install knockout-select-on-focus

Usage

<input type="text" data-bind="selectOnFocus: true">
Selects all text when the element is focused.

<input type="text" data-bind="selectOnFocus: /^[^\.]+/">
Selects all text before the first period when the element is focused.

<input type="text" data-bind="selectOnFocus: { pattern: /^[^\.]+/, onlySelectOnFirstFocus: true }">
Only select the pattern on the first focus.

License

Knockout.selectOnFocus is licensed under a standard 3-clause BSD license -- see the LICENSE-file for details.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.5
    988
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.5
    988
  • 0.1.4
    0
  • 0.1.1
    0
  • 0.1.2
    0
  • 0.1.3
    0

Package Sidebar

Install

npm i knockout-select-on-focus

Weekly Downloads

988

Version

0.1.5

License

none

Last publish

Collaborators

  • sunesimonsen
  • papandreou
  • maartenwinter