Skip to content

Commit ebf9092

Browse files
committed
Optional input value
1 parent 85813b7 commit ebf9092

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftHtml/Html/Tags/Input.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ public extension Input {
234234
}
235235

236236
/// Specifies the value of an `<input>` element
237-
func value(_ value: String) -> Self {
238-
node.upsert(Attribute(key: "value", value: value))
237+
func value(_ value: String?) -> Self {
238+
if let value = value {
239+
node.upsert(Attribute(key: "value", value: value))
240+
}
239241
return self
240242
}
241243

0 commit comments

Comments
 (0)