Skip to content

Commit

Permalink
bump version 1.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKau committed Feb 24, 2023
1 parent f7d4cd3 commit 9b90d94
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.0.19: 2023-02-24
## Added
* Set focus to search text field if url has a parameter with its name

### 1.0.18: 2023-02-17
## Fixed
* Error related to getting text search fields name.
Expand Down
4 changes: 2 additions & 2 deletions air-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://dude.fi
* License: GPL2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Version: 1.0.18
* Version: 1.0.19
*
* @package air-search
*/
Expand All @@ -16,7 +16,7 @@

defined( 'ABSPATH' ) || exit;

const PLUGIN_VERSION = '1.0.18';
const PLUGIN_VERSION = '1.0.19';

include plugin_dir_path( __FILE__ ) . '/query.php';
include plugin_dir_path( __FILE__ ) . '/helpers.php';
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"plugin"
],
"license": "GPL-3.0+",
"version": "1.0.18",
"version": "1.0.19",
"authors": [
{
"name": "Digitoimisto Dude Oy",
Expand Down
9 changes: 9 additions & 0 deletions scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ if (searchForm) {
});
}
}

if (searchField) {
const urlSearch = window.location.search;
const urlParams = new URLSearchParams(urlSearch);
if (urlParams.has(searchField.name)) {
// searchField.focus();
searchField.focus({ preventScroll: true });
}
}
}

function formSubmitEvent() {
Expand Down

0 comments on commit 9b90d94

Please sign in to comment.