D3vugu-components/components/input/text-area.go
2023-06-27 00:23:07 +02:00

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
}
}