Skip to content

changeValue

changeValue is a DOM event that occurs whenever the value of a h-input-stepper webcomponent changes.

Event body

The changeValue body has a TInputStepperChangeEvent type which represents the details of the targeted input stepper. It is optional so it might not exist.

Example

In this example we listen to changeValue event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    document.addEventListener('changeValue', (event) => {
        const value = event.detail?.value;

        console.log('h-input-stepper value has been changed to ', value);
    });
});