Hot fixed : app is crashing upon clicking on codehinter icon in isEditable field in table column (#6510)

* bug fixed app is getting crashed on clicking codehinter icon in isEditable field in table column

* made the suggested changes
This commit is contained in:
Manish Kushare 2023-05-25 17:44:08 +05:30 committed by GitHub
parent 1a461cd680
commit 7aa8293d60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import { CodeHinter } from '../../../CodeBuilder/CodeHinter';
export const ProgramaticallyHandleToggleSwitch = ({
currentState,
darkMode,
// eslint-disable-next-line no-unused-vars
label,
index,
callbackFunction,
@ -18,28 +19,29 @@ export const ProgramaticallyHandleToggleSwitch = ({
const param = { name: property };
const definition = { value, fxActive: props.fxActive };
const initialValue = definition?.value ?? `{{false}}`;
const options = {};
return (
<CodeHinter
enablePreview={true}
currentState={currentState}
initialValue={initialValue}
mode={options.mode}
theme={darkMode ? 'monokai' : options.theme}
lineWrapping={true}
onChange={(value) => callbackFunction(index, property, value)}
componentName={`widget/${component.name}::${label}`}
type={paramMeta.type}
paramName={param.name}
paramLabel={paramMeta.displayName}
fieldMeta={paramMeta}
onFxPress={(active) => {
callbackFunction(index, 'fxActive', active);
}}
fxActive={props?.fxActive ?? false}
component={component}
className="codehinter-default-input"
/>
<div className={`mb-2 field ${options.className}`} onClick={(e) => e.stopPropagation()}>
<CodeHinter
enablePreview={true}
currentState={currentState}
initialValue={initialValue}
mode={options.mode}
theme={darkMode ? 'monokai' : options.theme}
lineWrapping={true}
onChange={(value) => callbackFunction(index, property, value)}
componentName={`widget/${component?.component?.name}::${param.name}`}
type={paramMeta.type}
paramName={param.name}
paramLabel={paramMeta.displayName}
fieldMeta={paramMeta}
onFxPress={(active) => {
callbackFunction(index, 'fxActive', active);
}}
fxActive={props?.fxActive ?? false}
component={component.component}
className={options.className}
/>
</div>
);
};