mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
fix/event-fire-editor-ready (#10489)
* fix/event-fire-editor-ready * Resolved comments
This commit is contained in:
parent
a2852c2ed7
commit
df7f774b12
1 changed files with 2 additions and 2 deletions
|
|
@ -59,6 +59,7 @@ const BoxUI = (props) => {
|
|||
const { variablesExposedForPreview, exposeToCodeHinter } = useContext(EditorContext) || {};
|
||||
|
||||
const currentState = useCurrentState();
|
||||
const isEditorReady = useCurrentStateStore((state) => state.isEditorReady);
|
||||
|
||||
const validate = (value) =>
|
||||
validateWidget({
|
||||
|
|
@ -78,6 +79,7 @@ const BoxUI = (props) => {
|
|||
|
||||
let exposedVariables = !_.isEmpty(currentState?.components) ? currentState?.components[component.name] ?? {} : {};
|
||||
const fireEvent = (eventName, options) => {
|
||||
if (!isEditorReady) return;
|
||||
if (mode === 'edit' && eventName === 'onClick') {
|
||||
onComponentClick(id, component);
|
||||
}
|
||||
|
|
@ -98,8 +100,6 @@ const BoxUI = (props) => {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const isEditorReady = useCurrentStateStore((state) => state.isEditorReady);
|
||||
|
||||
return (
|
||||
<OverlayTrigger
|
||||
placement={inCanvas ? 'auto' : 'top'}
|
||||
|
|
|
|||
Loading…
Reference in a new issue