mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 08:28:35 +00:00
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:
parent
b62d19c066
commit
89f56410bd
2 changed files with 12 additions and 2 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -1061,7 +1061,9 @@ export const widgets = [
|
|||
},
|
||||
},
|
||||
},
|
||||
events: {},
|
||||
events: {
|
||||
onChange: { displayName: 'On change' },
|
||||
},
|
||||
styles: {
|
||||
visibility: {
|
||||
type: 'toggle',
|
||||
|
|
|
|||
Loading…
Reference in a new issue