File tree 2 files changed +14
-0
lines changed
src/client/packages/idom-client-react
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ const elementTransformCategories = {
49
49
return { } ;
50
50
}
51
51
} ,
52
+ hasElements : ( element ) => {
53
+ const result = { } ;
54
+ Object . keys ( element ) . forEach ( ( key ) => {
55
+ result [ key ] = serializeDomElement ( element . elements [ key ] )
56
+ } ) ;
57
+ return result ;
58
+ }
52
59
} ;
53
60
54
61
function defaultElementTransform ( element ) {
@@ -69,6 +76,7 @@ const elementTagCategories = {
69
76
] ,
70
77
hasCurrentTime : [ "AUDIO" , "VIDEO" ] ,
71
78
hasFiles : [ "INPUT" ] ,
79
+ hasElements : [ "FORM" ] ,
72
80
} ;
73
81
74
82
const elementTransforms = { } ;
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ const allTargetData = {
76
76
tagName,
77
77
output : { target : { currentTime : allTargetData . currentTime } } ,
78
78
} ) ) ,
79
+ ...[ "FORM" ] . map ( ( tagName ) => ( {
80
+ case : `adds 'value' attribute for ${ tagName } element` ,
81
+ tagName,
82
+ output : { target : { value : allTargetData . value } } ,
83
+ } ) ) ,
79
84
] . forEach ( ( expectation ) => {
80
85
test ( `serializeEvent() ${ expectation . case } ` , ( ) => {
81
86
const eventData = {
@@ -113,6 +118,7 @@ const allEventData = {
113
118
clientX : "clientX" ,
114
119
clientY : "clientY" ,
115
120
ctrlKey : "ctrlKey" ,
121
+ form : "form" ,
116
122
metaKey : "metaKey" ,
117
123
pageX : "pageX" ,
118
124
pageY : "pageY" ,
You can’t perform that action at this time.
0 commit comments