You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
im using below custom component like using select they t=can select the value and later user can edit it as per their required value.
im getting the value saved but again if the used want to edit the query builder is not opening
following is the query => [cwx_testoptionset].[set_values] = 'tes@123'
importReact,{useEffect,useState}from"react";constCustomComponent=(props: any)=>{const[selectedOption,setSelectedOption]=useState("");const[isEditing,setIsEditing]=useState(false);const[editedValue,setEditedValue]=useState("");useEffect(()=>{if(props.value){props.setEditedValueQueryBuilder(props.value);setSelectedOption(props.value);}},[]);consthandleSelectChange=(event: any)=>{debugger;setSelectedOption(event.target.value);setEditedValue(props.listValues?.find((el: any)=>el?.value===event.target.value)?.title);props.setValue(event.target.value);props.setEditedValueQueryBuilder(event.target.value);setIsEditing(true);};consthandleInputChange=(event: any)=>{setEditedValue(event.target.value);debugger;props.setValue(event.target.value);props.setEditedValueQueryBuilder(event.target.value);};consthandleBlur=()=>{setIsEditing(false);//setSelectedOption(editedValue);};return(<div>{isEditing ? (<inputtype="text"value={editedValue}onChange={handleInputChange}onBlur={handleBlur}autoFocus/>) : (<div>
our custom
<selectvalue={selectedOption}onChange={handleSelectChange}><optionvalue=""disabled>
Select an option
</option>{props.listValues.map(({ value, title }: any)=>(<optionvalue={value}>{title}</option>))}</select></div>)}</div>);};exportdefaultCustomComponent;
The text was updated successfully, but these errors were encountered:
im using below custom component like using select they t=can select the value and later user can edit it as per their required value.
im getting the value saved but again if the used want to edit the query builder is not opening
following is the query => [cwx_testoptionset].[set_values] = 'tes@123'
The text was updated successfully, but these errors were encountered: