Perseus
    Preparing search index...

    An input box that accepts only numeric strings

    Calls onChange(value, format) for valid numbers.

    Reverts to the current value onBlur or on [ENTER], but maintains the format (i.e. 3/2, 1 1/2, 150%)

    Accepts empty input and sends it to onChange as null if no numeric placeholder is set.

    If given a checkValidity function, will turn the background/outline red when invalid.

    If useArrowKeys is set to true, up/down arrows will increment/decrement integers.

    Optionally takes a size ("mini", "small", "normal"`)

    Hierarchy

    • Component<any, any>
      • NumberInput
    Index

    Constructors

    • Parameters

      • props: any

      Returns NumberInput

    • Parameters

      • props: any
      • context: any

      Returns NumberInput

    Properties

    _checkValidity: (arg1: any) => boolean = ...
    _getInput: () => HTMLInputElement = ...
    _handleBlur: (e?: KeyboardEvent<Element> | FocusEvent<Element, Element>) => void = ...
    _handleChange: (arg1: ChangeEvent<HTMLInputElement>) => void = ...
    _handleFocus: () => void = ...
    _onKeyDown: (arg1: KeyboardEvent) => void = ...
    _setValue: (arg1: number, arg2: MathFormat) => void = ...
    blur: () => void = ...
    focus: () => void = ...
    getSelectionEnd: () => number | null = ...
    getSelectionStart: () => number | null = ...
    getStringValue: () => string = ...
    getValue: () => any = ...
    inputRef: RefObject<HTMLInputElement> = ...
    parseInputValue: (arg1: any) => any = ...
    setSelectionRange: (arg1: number, arg2: number) => void = ...
    state: any = ...
    defaultProps: any = ...
    propTypes: {
        allowPiTruncation: any;
        checkValidity: any;
        format: any;
        label: any;
        onChange: any;
        onFormatChange: any;
        placeholder: any;
        size: any;
        value: any;
    } = ...

    Methods

    • Called immediately after updating occurs. Not called for the initial render.

      The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

      Parameters

      • prevProps: any

      Returns void