mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
[Bug]: Fixed app crashes when items dropped into container inside listview (#5449)
* Fixed app crashes when items dropped into container inside listview * Fixes Link widget crash
This commit is contained in:
parent
94f68039cb
commit
f6e23fbd65
2 changed files with 10 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useState, useMemo, useContext } from 'react';
|
||||
import React, { useEffect, useState, useMemo, useContext, useRef } from 'react';
|
||||
import { Button } from './Components/Button';
|
||||
import { Image } from './Components/Image';
|
||||
import { Text } from './Components/Text';
|
||||
|
|
@ -196,6 +196,8 @@ export const Box = function Box({
|
|||
|
||||
const { variablesExposedForPreview, exposeToCodeHinter } = useContext(EditorContext) || {};
|
||||
|
||||
const componentActions = useRef(new Set());
|
||||
|
||||
useEffect(() => {
|
||||
const currentPage = currentState?.page;
|
||||
|
||||
|
|
@ -309,11 +311,16 @@ export const Box = function Box({
|
|||
) {
|
||||
if (!Object.keys(exposedVariables).includes(actionName)) {
|
||||
func.dependencies = dependencies;
|
||||
componentActions.current.add(actionName);
|
||||
return onComponentOptionChanged(component, actionName, func);
|
||||
} else if (exposedVariables[actionName]?.dependencies?.length === 0) {
|
||||
return Promise.resolve();
|
||||
} else if (!_.isEqual(dependencies, exposedVariables[actionName]?.dependencies)) {
|
||||
} else if (
|
||||
JSON.stringify(dependencies) !== JSON.stringify(exposedVariables[actionName]?.dependencies) ||
|
||||
!componentActions.current.has(actionName)
|
||||
) {
|
||||
func.dependencies = dependencies;
|
||||
componentActions.current.add(actionName);
|
||||
return onComponentOptionChanged(component, actionName, func);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const Link = ({ height, properties, styles, fireEvent, registerAction, da
|
|||
async function () {
|
||||
clickRef.current.click();
|
||||
},
|
||||
[clickRef]
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue