We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
click
1 parent fd5bea3 commit bb4fd50Copy full SHA for bb4fd50
packages/form-js-editor/src/render/components/FormEditor.js
@@ -78,11 +78,22 @@ function Element(props) {
78
return () => eventBus.off('selection.changed', scrollIntoView);
79
}, [ id ]);
80
81
- function onClick(event) {
82
- event.stopPropagation();
+ const onClick = useCallback((event) => {
+
83
+ // TODO(nikku): refactor this to use proper DOM delegation
84
+ const fieldEl = event.target.closest('[data-id]');
85
86
+ if (!fieldEl) {
87
+ return;
88
+ }
89
90
+ const id = fieldEl.dataset.id;
91
92
+ if (id === field.id) {
93
+ selection.toggle(field);
94
95
+ }, [ field ]);
96
- selection.toggle(field);
- }
97
98
const classes = [ 'fjs-element' ];
99
0 commit comments