{"action":"created","issue":{"url":"https://api.github.com/repos/Dogfalo/materialize/issues/1876","labels_url":"https://api.github.com/repos/Dogfalo/materialize/issues/1876/labels{/name}","comments_url":"https://api.github.com/repos/Dogfalo/materialize/issues/1876/comments","events_url":"https://api.github.com/repos/Dogfalo/materialize/issues/1876/events","html_url":"https://github.com/Dogfalo/materialize/issues/1876","id":99830269,"number":1876,"title":"Materialize select creating infinite span.caret on update","user":{"login":"ahlechandre","id":7119058,"avatar_url":"https://avatars.githubusercontent.com/u/7119058?v=3","gravatar_id":"","url":"https://api.github.com/users/ahlechandre","html_url":"https://github.com/ahlechandre","followers_url":"https://api.github.com/users/ahlechandre/followers","following_url":"https://api.github.com/users/ahlechandre/following{/other_user}","gists_url":"https://api.github.com/users/ahlechandre/gists{/gist_id}","starred_url":"https://api.github.com/users/ahlechandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahlechandre/subscriptions","organizations_url":"https://api.github.com/users/ahlechandre/orgs","repos_url":"https://api.github.com/users/ahlechandre/repos","events_url":"https://api.github.com/users/ahlechandre/events{/privacy}","received_events_url":"https://api.github.com/users/ahlechandre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-08T19:45:25Z","updated_at":"2015-08-10T06:00:39Z","closed_at":null,"body":"trying to make select disabled dinamically by switch checkbox\r\n```javascript\r\n    var\r\n      hasItem = document.querySelector('input[name=\"has-item\"]'), // materialize switch\r\n      item = document.querySelector('select[name=\"item\"]');\r\n\r\n    $( item ).material_select();\r\n\r\n    hasItem.addEventListener( 'change', function ()\r\n    {\r\n      $( item ).material_select('destroy');\r\n      if ( this.checked === true )\r\n      {\r\n        if ( item.hasAttribute( 'disabled' ) )\r\n        {\r\n          item.removeAttribute( 'disabled' );\r\n        }\r\n      }\r\n      else\r\n      {\r\n        if ( !item.hasAttribute( 'disabled' ) )\r\n        {\r\n          item.setAttribute( 'disabled', '' );\r\n        }\r\n      }\r\n     $( item ).material_select();\r\n    } );\r\n```\r\nafter some switch actions on/off\r\n![materialize_select](https://cloud.githubusercontent.com/assets/7119058/9151933/2c204d5a-3dec-11e5-8be4-e74c1cddd134.jpg)\r\n\r\ncan someone explain to me why this occurs?"},"comment":{"url":"https://api.github.com/repos/Dogfalo/materialize/issues/comments/129315362","html_url":"https://github.com/Dogfalo/materialize/issues/1876#issuecomment-129315362","issue_url":"https://api.github.com/repos/Dogfalo/materialize/issues/1876","id":129315362,"user":{"login":"davismj","id":3845823,"avatar_url":"https://avatars.githubusercontent.com/u/3845823?v=3","gravatar_id":"","url":"https://api.github.com/users/davismj","html_url":"https://github.com/davismj","followers_url":"https://api.github.com/users/davismj/followers","following_url":"https://api.github.com/users/davismj/following{/other_user}","gists_url":"https://api.github.com/users/davismj/gists{/gist_id}","starred_url":"https://api.github.com/users/davismj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davismj/subscriptions","organizations_url":"https://api.github.com/users/davismj/orgs","repos_url":"https://api.github.com/users/davismj/repos","events_url":"https://api.github.com/users/davismj/events{/privacy}","received_events_url":"https://api.github.com/users/davismj/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T06:00:39Z","updated_at":"2015-08-10T06:00:39Z","body":"In my 0.97.0 copy, I have the following lines starting from 2730:\r\n```\r\n// Tear down structure if Select needs to be rebuilt\r\n      var lastID = $select.data('select-id');\r\n      if (lastID) {\r\n        $select.parent().find('i').remove();\r\n        $select.parent().find('input').remove();\r\n```\r\n\r\nThis does not match the [latest code](https://github.com/Dogfalo/materialize/blob/master/js/forms.js#L284). So it seems this issue is fixed and will be resolved when a new materialize is released."}}