diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 33244e135..34d943666 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -447,8 +447,12 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("advancedSettings")).Click(); s.Driver.FindElement(By.Id("toggleInputSelection")).Click(); s.Driver.WaitForElement(By.Id(spentOutpoint.ToString())); + Assert.Equal("true", s.Driver.FindElement(By.Name("InputSelection")).GetAttribute("value").ToLowerInvariant()); var el = s.Driver.FindElement(By.Id(spentOutpoint.ToString())); s.Driver.FindElement(By.Id(spentOutpoint.ToString())).Click(); + var inputSelectionSelect = s.Driver.FindElement(By.Name("SelectedInputs")); + Assert.Equal(1, inputSelectionSelect.FindElements(By.CssSelector("[selected]")).Count); + var bob = new Key().PubKey.Hash.GetAddress(Network.RegTest); SetTransactionOutput(s, 0, bob, 0.3m); s.Driver.FindElement(By.Id("SendMenu")).Click(); diff --git a/BTCPayServer/Views/Wallets/CoinSelection.cshtml b/BTCPayServer/Views/Wallets/CoinSelection.cshtml index 3c09ac781..abc93a257 100644 --- a/BTCPayServer/Views/Wallets/CoinSelection.cshtml +++ b/BTCPayServer/Views/Wallets/CoinSelection.cshtml @@ -179,7 +179,11 @@ $(function () { res.splice(this.selectedInputs.indexOf(item.outpoint),1); } - $("#SelectedInputs").val(res); + $("select option").each(function(){ + var selected = res.indexOf($(this).attr("value")) !== -1; + $(this).attr("selected",selected? "selected": null); + }); + this.selectedInputs = res; $(".crypto-balance-link").text(this.selectedAmount); }