integrations: Fix the search input autofocus.

There were two problems preventing the autofocus:

* The focus was triggered at the wrong time.
* transition: all; affected the visibility, making browsers
  abort the focus since the input was still hidden.
This commit is contained in:
Gittenburg 2020-07-28 22:28:56 +02:00 committed by Tim Abbott
parent e350e57747
commit 2367d56f74
2 changed files with 4 additions and 6 deletions

View File

@ -370,11 +370,9 @@ function integration_events() {
// combine selector use for both focusing the integrations searchbar and adding
// the input event.
$(".integrations .searchbar input[type='text']")
.trigger("focus")
.on("input", (e) => {
dispatch("UPDATE_QUERY", {query: e.target.value.toLowerCase()});
});
$(".integrations .searchbar input[type='text']").on("input", (e) => {
dispatch("UPDATE_QUERY", {query: e.target.value.toLowerCase()});
});
$(window).on("scroll", () => {
if (document.body.scrollTop > 330) {
@ -402,4 +400,5 @@ $(() => {
integration_events();
load_data();
dispatch("LOAD_PATH");
$(".integrations .searchbar input[type='text']").trigger("focus");
});

View File

@ -53,7 +53,6 @@ $category-text: hsl(219, 23%, 33%);
padding: 50px 0;
.inner-content {
transition: all 0.3s ease;
min-height: 870px;
.show {