Skip to content

Commit

Permalink
Optional input accept
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Dec 15, 2021
1 parent 8c7f3c5 commit 1b0f64c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/SwiftHtml/Html/Tags/Input.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public extension Input {
}

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

Expand Down

0 comments on commit 1b0f64c

Please sign in to comment.