On Change added to NumberInput (#4198)

* On Change added to NumberInput

* fixes lint errors

Co-authored-by: arpitnath <arpitnath42@gmail.com>
This commit is contained in:
Mike 2022-10-18 08:28:30 +01:00 committed by GitHub
parent b62d19c066
commit 89f56410bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -1,6 +1,13 @@
import React, { useEffect } from 'react';
export const NumberInput = function NumberInput({ height, properties, styles, setExposedVariable, component }) {
export const NumberInput = function NumberInput({
height,
properties,
styles,
setExposedVariable,
component,
fireEvent,
}) {
const { visibility, borderRadius } = styles;
const [value, setValue] = React.useState(parseInt(properties.value));
@ -19,6 +26,7 @@ export const NumberInput = function NumberInput({ height, properties, styles, se
} else {
setValue(parseInt(e.target.value));
}
fireEvent('onChange');
};
useEffect(() => {

View file

@ -1061,7 +1061,9 @@ export const widgets = [
},
},
},
events: {},
events: {
onChange: { displayName: 'On change' },
},
styles: {
visibility: {
type: 'toggle',