@CustomTag('main-app')
class MainApp extends PolymerElement {
@observable List data = toObservable([]);
@observable var selection;
@override
domReady() {
super.domReady();
load();
}
Future loadChallenges() async {
try {
List result = //loading....
data = toObservable(result);
} catch (e, stackTrace) {
.....
}
}
@ObserveProperty('data')
void setDefaultSelection() {
selection = data.firstWhere(...); // peak one to be selected by default
}
@ObserveProperty('selection')
onSelection() {
log.info("selected: $selection");
}
The outcome is not as expected: nothing is selected on application load
I would expect that the one selected in setDefaultSelection will have selected class.
In logs I see two lines from onSelection:
2015-08-07 20:38:58.865: selected: ... here is proper toString of desired element
2015-08-07 20:38:58.934: selected: null
It behaves like I've clicked twice on the same row, I assume that somewhere in the code it has false positive conclusion about selection.
So I have:
dart part:
The outcome is not as expected: nothing is selected on application load I would expect that the one selected in setDefaultSelection will have selected class.
In logs I see two lines from onSelection:
It behaves like I've clicked twice on the same row, I assume that somewhere in the code it has false positive conclusion about selection.
core_elements: version: "0.7.1+2" polymer: version: "0.16.3+3"