mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Set focus on search box when showing search panel
This commit is contained in:
parent
faea3a7564
commit
46b3a9c258
@ -43,6 +43,11 @@ class SearchPanel:
|
|||||||
event.preventDefault(), event.stopPropagation()
|
event.preventDefault(), event.stopPropagation()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def init(self):
|
||||||
|
tb = self.container.querySelector('input[name="search-books"]')
|
||||||
|
tb.focus()
|
||||||
|
tb.setSelectionRange(0, tb.value.length)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def container(self):
|
def container(self):
|
||||||
return document.getElementById(self.container_id)
|
return document.getElementById(self.container_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user