0.0.1 • Published 4 years ago

unfocused-input-buffer v0.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

unfocused-input-buffer

Ever typed a really long message only to realise the input field wasn't selected? Annoying isn't it? 😡

Why not buffer that bad boy and have it magically appear when the user focuses the field? ✨

What a pleasing user experience they will have! 🤩

Installation

yarn add unfocused-input-buffer

or

npm i unfocused-input-buffer --save

Usage

HTML

Add a class or data attribute to all the input fields you want to be buffered.

The default is data-buffered.

<input type="text" data-buffered />

JavaScript

Import and call the package with the optional options:

import unfocusedInputBuffer from 'unfocused-input-buffer'

unfocusedInputBuffer()

Options

OptionTypeDefaultDescription
selectorString[data-buffered]CSS selector to identify the target input fields.

Roadmap

  • Buffer lifespan interval
  • User prompt to insert buffer

Credits

This package is inspired by a paper titled Buffering and Inserting Text Inputs by Winson Chung.