{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/backbone-support/issues/22","labels_url":"https://api.github.com/repos/thoughtbot/backbone-support/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/backbone-support/issues/22/comments","events_url":"https://api.github.com/repos/thoughtbot/backbone-support/issues/22/events","html_url":"https://github.com/thoughtbot/backbone-support/issues/22","id":18060310,"number":22,"title":"Different behaviour Chrome and Firefox when using prop('selectedIndex',-1)","user":{"login":"invasionofsmallcubes","id":2406829,"avatar_url":"https://avatars.githubusercontent.com/u/2406829?v=3","gravatar_id":"","url":"https://api.github.com/users/invasionofsmallcubes","html_url":"https://github.com/invasionofsmallcubes","followers_url":"https://api.github.com/users/invasionofsmallcubes/followers","following_url":"https://api.github.com/users/invasionofsmallcubes/following{/other_user}","gists_url":"https://api.github.com/users/invasionofsmallcubes/gists{/gist_id}","starred_url":"https://api.github.com/users/invasionofsmallcubes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invasionofsmallcubes/subscriptions","organizations_url":"https://api.github.com/users/invasionofsmallcubes/orgs","repos_url":"https://api.github.com/users/invasionofsmallcubes/repos","events_url":"https://api.github.com/users/invasionofsmallcubes/events{/privacy}","received_events_url":"https://api.github.com/users/invasionofsmallcubes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-08-14T15:56:14Z","updated_at":"2015-03-16T08:58:40Z","closed_at":null,"body":"It's the first time I use backbone-support to handle zombie views.\r\nBefore introducing it, I did not have the following problem:\r\n\r\n        this.$el.append(this.template());\r\n    \r\n        // this view fills up a select with options taken from a web services\r\n        this.renderChildInto(new App.view.ResourcesView({name: \"idActivityDesc\", url: \"/wfc-services/resources/activities\"}), \"#divIdActivityDesc\");\r\n    \r\n        // population of the forms elements according to the loaded model\r\n        this.populateSelectElements();\r\n        this.populateTextElements();\r\n    \r\n        if(this.model.get('completed')) {\r\n            this.$(\"#active\").removeAttr(\"disabled\");\r\n        }\r\n    \r\n        this.delegateEvents(this.events);\r\n        return this;\r\n\r\nWith Firefox it's all working fine. If the model is empty the `select` elements are going to be set up with default elements. In my case is **selectedIndex** to **-1**.\r\n\r\nGoing in debug inside the view everything seems fine. I have the problem when the view is going to be happened to the parent via the method `renderChildInto`. The dom is fine, but without the changes derived from the `populateSelectElements()` if the model is empty. If it's not empty I have no problem and the view is working fine.\r\n\r\nI'm really puzzled about it because before the `return this;` statement, even in Chrome/Chromium I see the **selectedIndex** to **-1**. But in the final rendered view on the browser I see the select having **selectedIndex** to **0**.\r\n\r\nIn the composite_view.js the called code is:\r\n\r\n      renderChild: function(view) {\r\n        view.render();\r\n        this.children.push(view);\r\n        view.parent = this;\r\n      },\r\n      \r\n      renderChildInto: function(view, container) {\r\n        this.renderChild(view);\r\n        this.$(container).html(view.el);\r\n      },"},"comment":{"url":"https://api.github.com/repos/thoughtbot/backbone-support/issues/comments/81514112","html_url":"https://github.com/thoughtbot/backbone-support/issues/22#issuecomment-81514112","issue_url":"https://api.github.com/repos/thoughtbot/backbone-support/issues/22","id":81514112,"user":{"login":"invasionofsmallcubes","id":2406829,"avatar_url":"https://avatars.githubusercontent.com/u/2406829?v=3","gravatar_id":"","url":"https://api.github.com/users/invasionofsmallcubes","html_url":"https://github.com/invasionofsmallcubes","followers_url":"https://api.github.com/users/invasionofsmallcubes/followers","following_url":"https://api.github.com/users/invasionofsmallcubes/following{/other_user}","gists_url":"https://api.github.com/users/invasionofsmallcubes/gists{/gist_id}","starred_url":"https://api.github.com/users/invasionofsmallcubes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invasionofsmallcubes/subscriptions","organizations_url":"https://api.github.com/users/invasionofsmallcubes/orgs","repos_url":"https://api.github.com/users/invasionofsmallcubes/repos","events_url":"https://api.github.com/users/invasionofsmallcubes/events{/privacy}","received_events_url":"https://api.github.com/users/invasionofsmallcubes/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T08:58:40Z","updated_at":"2015-03-16T08:58:40Z","body":"@ecbypi I honestly cannot tell you, it has been ages. I'm not using backbone anymore."}}