Skip to content

Commit 46a43f9

Browse files
committed
[Feat]: #2095 add double click event on the Tree Component
1 parent 3eca6dc commit 46a43f9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

client/packages/lowcoder/src/comps/comps/treeComp/treeComp.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
SelectInputValidationSection,
2525
} from "../selectInputComp/selectInputConstants";
2626
import { selectInputValidate } from "../selectInputComp/selectInputConstants";
27-
import { SelectEventHandlerControl } from "comps/controls/eventHandlerControl";
27+
import { TreeEventHandlerControl } from "comps/controls/eventHandlerControl";
2828
import { trans } from "i18n";
2929
import { useContext } from "react";
3030
import { EditorContext } from "comps/editorState";
@@ -63,8 +63,7 @@ const childrenMap = {
6363
label: withDefault(LabelControl, { position: "column" }),
6464
autoHeight: AutoHeightControl,
6565
verticalScrollbar: withDefault(BoolControl, false),
66-
// TODO: more event
67-
onEvent: SelectEventHandlerControl,
66+
onEvent: TreeEventHandlerControl,
6867
style: styleControl(InputFieldStyle , 'style'),
6968
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false), 'labelStyle'),
7069
inputFieldStyle:styleControl(TreeStyle, 'inputFieldStyle')
@@ -127,6 +126,7 @@ const TreeCompView = (props: RecordConstructorToView<typeof childrenMap>) => {
127126
}}
128127
onFocus={() => props.onEvent("focus")}
129128
onBlur={() => props.onEvent("blur")}
129+
onDoubleClick={() => props.onEvent("doubleClick")}
130130
/>
131131
</ScrollBar>
132132
</Container>

client/packages/lowcoder/src/comps/controls/eventHandlerControl.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,13 @@ export const SelectEventHandlerControl = eventHandlerControl([
778778
blurEvent,
779779
] as const);
780780

781+
export const TreeEventHandlerControl = eventHandlerControl([
782+
changeEvent,
783+
focusEvent,
784+
blurEvent,
785+
doubleClickEvent,
786+
] as const);
787+
781788
export const ScannerEventHandlerControl = eventHandlerControl([
782789
clickEvent,
783790
// scannerSuccessEvent,

0 commit comments

Comments
 (0)