Numbers Prefer Multiplication

    @wojtekmaj/predict-input-value

    1.0.1 • Public • Published

    npm downloads tested with jest

    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 @wojtekmaj/predict-input-value or yarn add @wojtekmaj/predict-input-value.
    • Import by adding import predictInputValue from '@wojtekmaj/predict-input-value'.
    • Use it by writing const nextValue = predictInputValue(event).

    Example

    Conditions:

    • Input: value "hello"
    • Selected text: "ello"
    • Key pressed: i
    function onKeyPress(event) {
      const nextValue = predictInputValue(event); // "hi"
    }

    License

    The MIT License.

    Author

    Wojciech Maj
    kontakt@wojtekmaj.pl
    http://wojtekmaj.pl

    Keywords

    Install

    npm i @wojtekmaj/predict-input-value

    DownloadsWeekly Downloads

    245

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    13.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • wojtekmaj