Skip to content

Commit d028e02

Browse files
committed
feat: 增加搜索栏自动获得焦点功能
1 parent cc5fca1 commit d028e02

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/BootstrapBlazor.Region/Components/SelectCity.razor.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ export function init(id, invoke, options) {
88
if (el === null) {
99
return
1010
}
11-
const popover = Popover.init(el);
11+
const popover = Popover.init(el, {
12+
shownCallback: () => {
13+
if (searchInput != null) {
14+
searchInput.focus();
15+
}
16+
}
17+
});
1218

1319
const searchInput = el.querySelector(".search-text");
1420
if (searchInput) {

0 commit comments

Comments
 (0)