File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/client/packages/idom-client-react Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ const elementTransformCategories = {
4949 return { } ;
5050 }
5151 } ,
52+ hasElements : ( element ) => {
53+ const result = { } ;
54+ Object . keys ( element ) . forEach ( ( key ) => {
55+ result [ key ] = serializeDomElement ( element . elements [ key ] )
56+ } ) ;
57+ return result ;
58+ }
5259} ;
5360
5461function defaultElementTransform ( element ) {
@@ -69,6 +76,7 @@ const elementTagCategories = {
6976 ] ,
7077 hasCurrentTime : [ "AUDIO" , "VIDEO" ] ,
7178 hasFiles : [ "INPUT" ] ,
79+ hasElements : [ "FORM" ] ,
7280} ;
7381
7482const elementTransforms = { } ;
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ const allTargetData = {
7676 tagName,
7777 output : { target : { currentTime : allTargetData . currentTime } } ,
7878 } ) ) ,
79+ ...[ "FORM" ] . map ( ( tagName ) => ( {
80+ case : `adds 'value' attribute for ${ tagName } element` ,
81+ tagName,
82+ output : { target : { value : allTargetData . value } } ,
83+ } ) ) ,
7984] . forEach ( ( expectation ) => {
8085 test ( `serializeEvent() ${ expectation . case } ` , ( ) => {
8186 const eventData = {
@@ -113,6 +118,7 @@ const allEventData = {
113118 clientX : "clientX" ,
114119 clientY : "clientY" ,
115120 ctrlKey : "ctrlKey" ,
121+ form : "form" ,
116122 metaKey : "metaKey" ,
117123 pageX : "pageX" ,
118124 pageY : "pageY" ,
You can’t perform that action at this time.
0 commit comments