diff --git a/src/components/dialogs/edit-widget-control-creator.js b/src/components/dialogs/edit-widget-control-creator.js index 5a4f716..ebcfcf1 100644 --- a/src/components/dialogs/edit-widget-control-creator.js +++ b/src/components/dialogs/edit-widget-control-creator.js @@ -80,7 +80,8 @@ export default function createControls(widgetType = null, widget = null, session break; case 'Table': dialogControls.push( - validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} /> + validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} />, + handleChange(e)} /> ); break; case 'Image': @@ -130,11 +131,15 @@ export default function createControls(widgetType = null, widget = null, session ); break; case 'Button': + let buttonBoundOnChange = (e) => { + handleChange([e, {target: {id: 'signal', value: 0}}]); + } dialogControls.push( - validateForm(id)} handleChange={(e) => handleChange(e)} />, - validateForm(id)} handleChange={(e) => handleChange(e)} />, - validateForm(id)} simulationModels={simulationModels} handleChange={(e) => valueBoundOnChange(e)} />, - validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} /> + validateForm(id)} simulationModels={simulationModels} handleChange={(e) => buttonBoundOnChange(e)} />, + validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} />, + handleChange(e)} />, + handleChange(e)} />, + handleChange(e)} /> ); break; case 'Box': @@ -164,10 +169,13 @@ export default function createControls(widgetType = null, widget = null, session break; case 'Input': + let inputBoundOnChange = (e) => { + handleChange([e, {target: {id: 'signal', value: 0}}]); + } dialogControls.push( validateForm(id)} handleChange={e => handleChange(e)} />, - validateForm(id)} simulationModels={simulationModels} handleChange={(e) => valueBoundOnChange(e)} />, - validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} /> + validateForm(id)} simulationModels={simulationModels} handleChange={(e) => inputBoundOnChange(e)} />, + validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} /> ); break;