PixiDom - v1.0.0
    Preparing search index...

    Type Alias BeforeInputEvent

    Cancelable event emitted as 'beforeinput' right before text is mutated or an undo/redo is applied — the same contract the DOM uses: call preventDefault() inside a listener to block the operation.

    textField.on('beforeinput', (event) => {
    if (event.inputType === 'insertText' && event.data === '!') {
    event.preventDefault(); // reject exclamation marks
    }
    if (event.inputType === 'historyUndo') {
    event.preventDefault(); // handle undo yourself
    }
    });
    type BeforeInputEvent = {
        cancelable: true;
        data: string | null;
        defaultPrevented: boolean;
        inputType: InputType;
        nativeEvent: KeyboardLikeEvent | ClipboardEvent;
        preventDefault(): void;
    }
    Index

    Properties

    cancelable: true
    data: string | null

    Text being inserted (insertText/insertFromPaste), null for deletions and history.

    defaultPrevented: boolean
    inputType: InputType
    nativeEvent: KeyboardLikeEvent | ClipboardEvent

    The keyboard or clipboard event that triggered the operation.

    Methods