8000 Fix trait selection requiring extra key press to update by ShaPhi7 · Pull Request #297 · pvpoke/pvpoke · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix trait selection requiring extra key press to update #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/js/interface/PokeSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var pokeSearch = new function(){
searchStr = $(this).val().toLowerCase().trim();
context = $(this).attr("context");


$target = $(e.target).closest(".poke-search-container");

// Reset the timeout when a new key is typed. This prevents queries from being submitted too quickly and bogging things down on mobile.
Expand Down Expand Up @@ -76,6 +75,8 @@ var pokeSearch = new function(){
e.preventDefault();
modalWindow("Search Traits", $(".search-traits-selector"));

pokeSearch = e.target.parentElement.querySelector(".poke-search");

// Populate traits
var traits = GameMaster.getInstance().data.pokemonTraits;

Expand All @@ -89,7 +90,7 @@ var pokeSearch = new function(){

// Prefill with existing search query

var searchArr = $(".poke-search").val().split("&");
var searchArr = $(pokeSearch).val().split("&");

for(var i = 0; i < searchArr.length; i++){
$(".modal .traits > div[value=\""+searchArr[i]+"\"]").addClass("selected");
Expand All @@ -109,8 +110,8 @@ var pokeSearch = new function(){
searchArr.push($(this).attr("value"));
});

$(".poke-search").val(searchArr.join("&"));
$(".poke-search").trigger("keyup");
$(pokeSearch).val(searchArr.join("&"));
$(pokeSearch).trigger("keyup");

closeModalWindow();
});
Expand Down
0