Giraffe.ViewEngine icon indicating copy to clipboard operation
Giraffe.ViewEngine copied to clipboard

Rendered forms are missing closing tags

Open TheAutomatingMrLynch opened this issue 1 year ago • 4 comments

Hi, I am fairly new to Giraffe and the view engine but I like it very much so far. I have however been facing something that seems to be a bug with forms not having a close tag when rendered. To be honest I do not know whether this is an issue with Giraffe or the view engine.

Steps to replicate:

  • Add following F# code to a view:
div [_id "page-column-1"] [
    form [_class "add-form"] [
        label [_for "name" ] [ str "Name: " ]
        input [_type "text"; _id "name"; _name "name" ] 
        input [_type "submit"; _value "New" ] 
    ]

    form [_class "add-form"] [
        label [_for "name2" ] [ str "Name2: " ]
        input [_type "text"; _id "name2"; _name "name2" ]
        input [_type "submit"; _value "Copy" ]
    ]
]
  • Run your application and locate the forms in raw HTML:
<div id="page-column-1">
	<form class="add-form">
		<label for="name">Name: </label>
		<input type="text" id="name" name="name">
		<input type="submit" value="New" />
		<form class="add-form">
			<label for="name2">Name2: </label>
			<input type="text" id="name2" name="name2">
			<input type="submit" value="Copy" />
</div>

TheAutomatingMrLynch avatar Oct 20 '24 20:10 TheAutomatingMrLynch