Skip to content

Commit 1b0f64c

Browse files
committed
Optional input accept
1 parent 8c7f3c5 commit 1b0f64c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftHtml/Html/Tags/Input.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ public extension Input {
5252
}
5353

5454
/// Specifies a filter for what file types the user can pick from the file input dialog box (only for type="file")
55-
func accept(_ value: String) -> Self {
56-
node.upsert(Attribute(key: "accept", value: value))
55+
func accept(_ value: String?) -> Self {
56+
if let value = value {
57+
node.upsert(Attribute(key: "accept", value: value))
58+
}
5759
return self
5860
}
5961

0 commit comments

Comments
 (0)