Fix text field focus after repeated open (#376)

For #333
This commit is contained in:
Feross Aboukhadijeh
2016-04-10 18:34:11 -07:00
parent 45f6cc5247
commit 4c4caba002

View File

@@ -11,10 +11,11 @@ function OpenTorrentAddressModal (state) {
<div class='open-torrent-address-modal'>
<p><strong>Enter torrent address or magnet link</strong></p>
<p>
<input id='add-torrent-url' type='text' autofocus onkeypress=${handleKeyPress} />
<input id='add-torrent-url' type='text' onkeypress=${handleKeyPress} />
<button class='primary' onclick=${handleOK}>OK</button>
<button class='cancel' onclick=${handleCancel}>Cancel</button>
</p>
<script>document.querySelector('#add-torrent-url').focus()</script>
</div>
`
}