Skip to content

Commit eb244e1

Browse files
committed
event handler added
1 parent e57b10f commit eb244e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import { PaddingControl } from "../controls/paddingControl";
2020

2121
import React, { useContext } from "react";
2222
import { EditorContext } from "comps/editorState";
23+
import { clickEvent, eventHandlerControl } from "../controls/eventHandlerControl";
24+
25+
const EventOptions = [clickEvent] as const;
2326

2427
const getStyle = (style: TextStyleType) => {
2528
return css`
@@ -126,6 +129,7 @@ let TextTmpComp = (function () {
126129
"text",
127130
trans("textShow.text", { name: "{{currentUser.name}}" })
128131
),
132+
onEvent: eventHandlerControl(EventOptions),
129133
autoHeight: AutoHeightControl,
130134
type: dropdownControl(typeOptions, "markdown"),
131135
horizontalAlignment: alignWithJustifyControl(),
@@ -148,6 +152,7 @@ let TextTmpComp = (function () {
148152
textAlign: props.horizontalAlignment,
149153
rotate: props.style.rotation
150154
}}
155+
onClick={() => props.onEvent("click")}
151156
>
152157
{props.type === "markdown" ? <TacoMarkDown>{value}</TacoMarkDown> : value}
153158
</TextContainer>
@@ -168,6 +173,7 @@ let TextTmpComp = (function () {
168173
{["logic", "both"].includes(useContext(EditorContext).editorModeStatus) && (
169174
<Section name={sectionNames.interaction}>
170175
{hiddenPropertyView(children)}
176+
{children.onEvent.getPropertyView()}
171177
</Section>
172178
)}
173179

0 commit comments

Comments
 (0)