You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
464 B
Go

package input
import (
"github.com/vugu/vugu"
)
// TextArea is a text or number based input component.
// The HTML input type is determined by the bound data type.
type TextArea struct {
AttrMap vugu.AttrMap
Bind *string
}
func (c *TextArea) content() string {
if c.Bind != nil {
return *c.Bind
}
return ""
}
func (c *TextArea) handleChange(event vugu.DOMEvent) {
val := event.PropString("target", "value")
if c.Bind != nil {
*c.Bind = val
}
}