Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListView: selection does not update on list change #1

Closed
TheWrathOfConst opened this issue Feb 23, 2015 · 1 comment
Closed

ListView: selection does not update on list change #1

TheWrathOfConst opened this issue Feb 23, 2015 · 1 comment
Assignees
Milestone

Comments

@TheWrathOfConst
Copy link
Collaborator

Repro page:

<!DOCTYPE html>
<html ng-app="testApp" ng-controller="test">
<head>
    <script src="angular.js"></script>
    <script src="WinJS.js"></script>
    <script src="angular-winjs.js"></script>
    <link href="ui-dark.css" rel="stylesheet" />
</head>
<body>

    <script>
        var module = angular.module('testApp', ['winjs']);
        var controller = module.controller("test", function ($scope) {
            $scope.selection = [1];
            $scope.data = ["A", "B", "C"];
            $scope.addItem = function () {
                $scope.data.unshift("D");
            }
        })

        WinJS.UI.processAll();
    </script>
    <button ng-click="addItem()">Add Item</button>
    Selection: {{selection}}
    <win-list-view item-data-source='data' selection="selection">
        <win-item-template>{{item.data}}</win-item-template>
    </win-list-view>

</body>
</html>

Repro steps:

  1. Open page, press "Add Item" button

Expected: selection updates to [2] when item is inserted in front
Actual: selection remains [1]

@TheWrathOfConst
Copy link
Collaborator Author

Resolved via commit fa5d6dd (the bug was in WinJS, which was resolved in WinJS 4.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants