@crabas0npm2/reiciendis-aliquam-necessitatibus
v1.0.0
Published
[![npm](https://img.shields.io/npm/v/@crabas0npm2/reiciendis-aliquam-necessitatibus.svg)](https://www.npmjs.com/package/@crabas0npm2/reiciendis-aliquam-necessitatibus) ![downloads](https://img.shields.io/npm/dt/@crabas0npm2/reiciendis-aliquam-necessitatib
Downloads
2
Maintainers
Keywords
Readme
Predict-Input-Value
Predicts the input value during KeyDown or KeyPress events, before the input is actually changed.
tl;dr
- Install by executing
npm install @crabas0npm2/reiciendis-aliquam-necessitatibus
oryarn add @crabas0npm2/reiciendis-aliquam-necessitatibus
. - Import by adding
import predictInputValue from '@crabas0npm2/reiciendis-aliquam-necessitatibus'
. - Use it by writing
const nextValue = predictInputValue(event)
.
Example
Conditions:
- Input: value
"hello"
- Selected text:
"ello"
- Key pressed:
i
function onKeyPress(event: React.KeyboardEvent<HTMLInputElement>): void {
const nextValue = predictInputValue(event); // "hi"
}
License
The MIT License.