{"action":"created","issue":{"url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/issues/33","repository_url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow","labels_url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/issues/33/comments","events_url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/issues/33/events","html_url":"https://github.com/vaadin/vaadin-tabs-flow/issues/33","id":305901410,"number":33,"title":"Reordering tabs breaks programmatic selection","user":{"login":"heruan","id":851745,"avatar_url":"https://avatars2.githubusercontent.com/u/851745?v=4","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"labels":[{"id":724714969,"url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/milestones/13","html_url":"https://github.com/vaadin/vaadin-tabs-flow/milestone/13","labels_url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/milestones/13/labels","id":3214816,"number":13,"title":"1.0 Maintenance","description":"Bug backlog for Flow and component Java APIs 1.0 (included in V10)","creator":{"login":"pleku","id":1478381,"avatar_url":"https://avatars1.githubusercontent.com/u/1478381?v=4","gravatar_id":"","url":"https://api.github.com/users/pleku","html_url":"https://github.com/pleku","followers_url":"https://api.github.com/users/pleku/followers","following_url":"https://api.github.com/users/pleku/following{/other_user}","gists_url":"https://api.github.com/users/pleku/gists{/gist_id}","starred_url":"https://api.github.com/users/pleku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleku/subscriptions","organizations_url":"https://api.github.com/users/pleku/orgs","repos_url":"https://api.github.com/users/pleku/repos","events_url":"https://api.github.com/users/pleku/events{/privacy}","received_events_url":"https://api.github.com/users/pleku/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"closed","created_at":"2018-03-25T08:44:56Z","updated_at":"2018-04-23T10:42:36Z","due_on":null,"closed_at":"2018-03-30T07:20:20Z"},"comments":4,"created_at":"2018-03-16T11:57:46Z","updated_at":"2018-04-23T10:42:36Z","closed_at":"2018-04-23T10:42:36Z","author_association":"NONE","body":"If tabs are reordered from server side, then `Tabs::setSelectedTab` selects the wrong tab. E.g.\r\n\r\n```java\r\nTabs tabs = new Tabs();\r\nTab first = new Tab();\r\nTab second = new Tab();\r\ntabs.add(first, second);\r\ntabs.replace(first, second); // swap tabs\r\ntabs.setSelectedTab(first); // will select `second' instead\r\n```\r\n\r\nThis seems to be caused by `Tabs::setSelectedTab` which trusts the posistion of the tab element and uses that as the value for the `selected` attribute of `<vaadin-tabs>`, but the Web Component keeps a different indexing strategy which is not affected by reordering.\r\n\r\nThus, after reordering selection works on the client but not from the server."},"comment":{"url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/issues/comments/383532268","html_url":"https://github.com/vaadin/vaadin-tabs-flow/issues/33#issuecomment-383532268","issue_url":"https://api.github.com/repos/vaadin/vaadin-tabs-flow/issues/33","id":383532268,"user":{"login":"ZheSun88","id":31067185,"avatar_url":"https://avatars2.githubusercontent.com/u/31067185?v=4","gravatar_id":"","url":"https://api.github.com/users/ZheSun88","html_url":"https://github.com/ZheSun88","followers_url":"https://api.github.com/users/ZheSun88/followers","following_url":"https://api.github.com/users/ZheSun88/following{/other_user}","gists_url":"https://api.github.com/users/ZheSun88/gists{/gist_id}","starred_url":"https://api.github.com/users/ZheSun88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZheSun88/subscriptions","organizations_url":"https://api.github.com/users/ZheSun88/orgs","repos_url":"https://api.github.com/users/ZheSun88/repos","events_url":"https://api.github.com/users/ZheSun88/events{/privacy}","received_events_url":"https://api.github.com/users/ZheSun88/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T10:42:36Z","updated_at":"2018-04-23T10:42:36Z","author_association":"CONTRIBUTOR","body":"Have updated the app to use platform beta8. and the problem cannot be reproduced any more. @heruan Could you verify it again. \r\n\r\nI will close this ticket for now, reopen if it is needed."}}
{"actor":{"display_login":"ZheSun88"}}