Added explicit bool attribute type

This commit is contained in:
2019-04-26 20:49:10 -06:00
parent 01d8048892
commit e0ccb4549e
4 changed files with 23 additions and 11 deletions

View File

@ -139,10 +139,10 @@ func Content(value string) hatmill.Attrib {
}
// Contenteditable creates a "contenteditable" attribute
func Contenteditable(value string) hatmill.Attrib {
func Contenteditable(value bool) hatmill.Attrib {
return hatmill.Attrib{
Key: "contenteditable",
Value: value,
Value: strconv.FormatBool(value),
}
}
@ -239,10 +239,10 @@ func Download(value string) hatmill.Attrib {
}
// Draggable creates a "draggable" attribute
func Draggable(value string) hatmill.Attrib {
func Draggable(value bool) hatmill.Attrib {
return hatmill.Attrib{
Key: "draggable",
Value: value,
Value: strconv.FormatBool(value),
}
}
@ -644,10 +644,10 @@ func Span(value int) hatmill.Attrib {
}
// Spellcheck creates a "spellcheck" attribute
func Spellcheck(value string) hatmill.Attrib {
func Spellcheck(value bool) hatmill.Attrib {
return hatmill.Attrib{
Key: "spellcheck",
Value: value,
Value: strconv.FormatBool(value),
}
}