summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--management/editor/elements.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/management/editor/elements.go b/management/editor/elements.go
index bb2cb3f..b536730 100644
--- a/management/editor/elements.go
+++ b/management/editor/elements.go
@@ -32,6 +32,15 @@ func Input(fieldName string, p interface{}, attrs map[string]string) []byte {
// The `fieldName` argument will cause a panic if it is not exactly the string
// form of the struct field that this editor input is representing
func Textarea(fieldName string, p interface{}, attrs map[string]string) []byte {
+ // add materialize css class to make UI correct
+ className := "materialize-textarea"
+ if _, ok := attrs["class"]; ok {
+ class := attrs["class"]
+ attrs["class"] = class + " " + className
+ } else {
+ attrs["class"] = className
+ }
+
e := newElement("textarea", attrs["label"], fieldName, p, attrs)
return domElement(e)