In the following demo you can create input components either by clicking the button or by pressing return/enter inside an input, everything works as expected except if you press return inside the lowest input at any given time, if I do that a new input will be created as expected but the one you were in isn't rendered with a value (try hitting return a few times if no problem occurs on the first try), how come?
Also, is it really necessary to re-set values using .setValue() every time I do .render()?
jsFiddle:
http://jsfiddle.net/nxYMH/1/Code:
enyo.kind({
Comments
2) you hook up createNode as an event handler, but it lacks the standard (onSender, onEvent) parameters so it gets an invalid value when you click on the button to activate it.
3) addChild is a protected function, so should not be called.
4) You should use the setValue method instead of directly accessing the value property.
Here's an updated version of your fiddle. http://jsfiddle.net/nxYMH/3/
It uses a custom onAddNode event to let the rwListItem tell its owner to add a node without that component needing to know the structure of the node.
I didn't see a good way to implement your feature of adding the node after the one where you hit enter without directly using the children array, something you shouldn't do. I made an alternate here where you use a repeater and a data model at http://jsfiddle.net/nxYMH/4/
If I use Enyo 2.2 to get the value of an input component through .getValue() called through the oninput event (when I start writing stuff into the input) I get the correct value, but if I use Enyo nightly the latest character is missing from the string returned by .getValue().
(Try writing in the input and observe console.log output):
Enyo 2.2: http://jsfiddle.net/nxYMH/5/
Enyo Nightly: http://jsfiddle.net/nxYMH/6/
Can you try a local version of nightly and set oninput in the handlers block for enyo,RichText to be "updateValue" instead of null?