File tree Expand file tree Collapse file tree 2 files changed +30
-32
lines changed
Expand file tree Collapse file tree 2 files changed +30
-32
lines changed Original file line number Diff line number Diff line change @@ -39,39 +39,36 @@ <h2>Demo molecule</h2>
3939 < div >
4040 < button type ="submit "> Render</ button >
4141 </ div >
42- < div class ="space-y-0.5 ">
43- < label class ="block ">
44- Width
45- < input
46- type ="number "
47- id ="width "
48- name ="width "
49- value ="600 "
50- class ="p-0.5 border border-gray-500 "
51- />
52- </ label >
53- < label class ="block ">
54- Height
55- < input
56- type ="number "
57- id ="height "
58- name ="height "
59- value ="400 "
60- class ="p-0.5 border border-gray-500 "
61- />
62- </ label >
63- < label class ="block ">
64- Max AVBL
65- < input
66- type ="number "
67- id ="maxAVBL "
68- name ="maxAVBL "
69- value ="0 "
70- class ="p-0.5 border border-gray-500 "
71- />
72- </ label >
42+ < div
43+ class ="grid grid-template gap-y-0.5 gap-x-2 w-fit items-center "
44+ style ="grid-template-columns: fit-content(100%) 1fr "
45+ >
46+ < label for ="width "> Width </ label >
47+ < input
48+ type ="number "
49+ id ="width "
50+ name ="width "
51+ value ="600 "
52+ class ="p-0.5 border border-gray-500 "
53+ />
54+ < label for ="height "> Height </ label >
55+ < input
56+ type ="number "
57+ id ="height "
58+ name ="height "
59+ value ="400 "
60+ class ="p-0.5 border border-gray-500 "
61+ />
62+ < label for ="maxAVBL "> Max AVBL </ label >
63+ < input
64+ type ="number "
65+ id ="maxAVBL "
66+ name ="maxAVBL "
67+ value ="0 "
68+ class ="p-0.5 border border-gray-500 "
69+ />
7370 </ div >
74- < div id ="checkboxes " class ="flex flex-col gap-0.5 "> </ div >
71+ < div id ="checkboxes " class ="grid grid-cols-2 gap-x-4 gap-y -0.5 "> </ div >
7572 </ form >
7673 </ div >
7774 < div class ="space-y-2 ">
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ for (const [name, label] of Object.entries(booleanOptions)) {
6565
6666const form = document . getElementById ( 'form' ) as HTMLFormElement ;
6767const result = document . getElementById ( 'result' ) as HTMLDivElement ;
68+ form . addEventListener ( 'change' , ( ) => form . requestSubmit ( ) ) ;
6869form . addEventListener ( 'submit' , ( event ) => {
6970 event . preventDefault ( ) ;
7071 const formData = new FormData ( form ) ;
You can’t perform that action at this time.
0 commit comments