Closed electricface closed 5 years ago
The following code can reproduce the problem:
package main import ( "github.com/gopherjs/vecty" "github.com/gopherjs/vecty/elem" ) func main() { vecty.RenderBody(&MyComponent{}) } type MyComponent struct { vecty.Core } func (mc *MyComponent) Render() vecty.ComponentOrHTML { return elem.Body( elem.Input( vecty.Markup( vecty.Property("list", "datalist1"), ), ), ) }
console error:
TypeError: setting getter-only property "list" ..js:9392:37 Set http://localhost:8080/..js:9392 Set http://localhost:8080/..js:9394 reconcileProperties http://localhost:8080/..js:8039 reconcile http://localhost:8080/..js:7964 render http://localhost:8080/..js:8978 reconcileChildren http://localhost:8080/..js:8344 reconcile http://localhost:8080/..js:7969 renderComponent http://localhost:8080/..js:9102 RenderBody http://localhost:8080/..js:9322 main http://localhost:8080/..js:9669 $init http://localhost:8080/..js:9693 $goroutine http://localhost:8080/..js:1478 $runScheduled http://localhost:8080/..js:1518 $schedule http://localhost:8080/..js:1534 $go http://localhost:8080/..js:1510 <anonymous> http://localhost:8080/..js:9704 <anonymous> http://localhost:8080/..js:9707
The current solution is to modify the list property by calling the setAttribute method on the focus event.
If you want to set an attribute rather than a property, use vecty.Attribute() instead of vecty.Property().
vecty.Attribute()
vecty.Property()
Already solved, thank you very much.
The following code can reproduce the problem:
console error:
The current solution is to modify the list property by calling the setAttribute method on the focus event.