File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/form-js-editor/src/render Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,22 @@ export default class Renderer {
36
36
} ) ;
37
37
} ) ;
38
38
39
+ // emit poor mans <element.hover> event
40
+ // when hovering the form container
41
+ container . addEventListener ( 'mouseover' , function ( ) {
42
+ eventBus . fire ( 'element.hover' ) ;
43
+ } ) ;
44
+
45
+ // ensure we focus the container if the users clicks
46
+ // inside; this follows input focus handling closely
47
+ container . addEventListener ( 'click' , function ( event ) {
48
+
49
+ // force focus when clicking container
50
+ if ( ! container . contains ( document . activeElement ) ) {
51
+ container . focus ( { preventScroll : true } ) ;
52
+ }
53
+ } ) ;
54
+
39
55
eventBus . on ( 'element.hover' , function ( ) {
40
56
if ( document . activeElement === document . body ) {
41
57
container . focus ( { preventScroll : true } ) ;
You can’t perform that action at this time.
0 commit comments