I have found a problem with the repeater data binding. I have a select with options generated by a repeater. Another select controls the source of the repeater. When the selection changes in the parent select, the child select fills with the children of the selection. But if two choices in the parent select generate the same text for the options, but different model.bind (or value.bind), changing between those two choices does not refresh the repeater as it should.
It’s a little difficult to explain more clearly. Here is some code to demonstrate the bug. Changing from Number one to Number two or Number three, the selection is made in the lower select. But changing between number two and number three, the model is not updated.
app.ts:
import { Parent, Child } from ‘./model’;
import { observable } from ‘aurelia-binding’;
Thank you for doing that. The sandbox is not working for me. The @observable handler is not being called. Thus after any selection change, selectedChild goes to -1. The behavior I’m seeing is that selectedChild is properly set when switching from Number one to Number two, but it is not set when switching from Number two to Number three.
I can’t see any reason @observable isn’t working. The relevant portions of tsconfig are more or less the same as mine.
I updated the sandbox to easily demonstrate the problem:
At first, Number one is selected, and the default Child 5 is selected
Select Number two. The default First Child is selected.
Now select number one again. The default Child 5 is selected.
Now select number three. The default First Child is selected. Everything works as expected.
Finally select number two. Nothing is selected in the lower list.
Moving back and forth shows that no selection is made any time switching between Number two and Number three. Switching between one and two or one and three works as expected.
This is a bug! The only reason it doesn’t work is because the text in the select options is the same. The model is not the same. The contents of the second select should refresh, but they don’t.
Forgive the outsider questions, but what is the time frame for a production release of Aurelia 2 and how much effort would it take to port a large application from 1 to 2?
It’s been answered before on discourse, i’ll find the links. Mainly it’s simple to no changes for higher templating features, for lower level features, such as factory and view, the API will change. So you can expect all your code will work the same, except where you manually craft stuff