| 5 | **UPDATE** this is happening only if you have pass1 field autocompleted by the browser. This is the condition to trigger the flow described below: |
| 6 | |
| 7 | https://github.com/WordPress/WordPress/blob/master/wp-admin/js/user-profile.js#L182 |
| 8 | bindPass1() makes use of generatePassword() which makes use of $toggleButton (still undeclared at this point). |
| 9 | |
| 10 | But $toggleButton is defined later on, here: |
| 11 | https://github.com/WordPress/WordPress/blob/master/wp-admin/js/user-profile.js#L212 |
| 12 | |
| 13 | So I think the patch attached to this post will work, but moving bindToggleButton() before line 180 would be even better. |