@@ -23,10 +23,11 @@ class Input : public ui::Controller {
2323 Property<String> allowRegex{this , " allow" , " " };
2424 Property<String> text{this , " text" , " " };
2525 Property<String> spanId{this , " span" , " value" };
26+ Property<String> value{this , " value" , " " , &Input::changeValue};
2627 ui::Node* span = nullptr ;
2728
28- Property<String> state{ this , " state " , " enabled " , &Input::changeState};
29- void changeState () {
29+ void changeValue () {
30+ node ()-> set ( " text " , *value);
3031 }
3132
3233 void attach () override {
@@ -136,7 +137,7 @@ class Input : public ui::Controller {
136137 offset += insert.size ();
137138 }
138139 node ()->set (" text" , Font::toString (entities, false ));
139- node ()->set (" value" , Font::toString (entities, true ));
140+ node ()->set (" value" , *value = Font::toString (entities, true ));
140141 }
141142
142143 void eventHandler (const ui::TextEvent& event) {
@@ -187,7 +188,7 @@ class Input : public ui::Controller {
187188 }
188189 if (changed) {
189190 node ()->set (" text" , Font::toString (entities, false ));
190- node ()->set (" value" , Font::toString (entities, true ));
191+ node ()->set (" value" , *value = Font::toString (entities, true ));
191192 node ()->processEvent (ui::Changed{node ()});
192193 }
193194 } else if (keyName == " RIGHT" ) {
0 commit comments