Skip to content

Commit

Permalink
Card selection UI stuck when history back option is used, dirty fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz Sosnowski committed Nov 28, 2024
1 parent 98a4082 commit 0e086fe
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Application/views/frontend/tpl/stripecreditcard.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,18 @@
$stripeRadio.trigger('click');
}
// Reset used card selection when Stripe is selected
if ($stripeRadio.is(':checked')) {
$stripeUsedCardSelect.prop('selectedIndex', 0);
}
//this is a dirty fix for selecting firs card selection element so the card UI not stuck when customer
// uses the browsers history back
setTimeout(function (){
const $stripeCardDD = $stripeRadio.parents('dt').next('dd');
const $stripeUsedCardSelect = $stripeCardDD.find('#stripe_used_card');
// Reset used card selection when Stripe is selected
if ($stripeRadio.is(':checked')) {
$stripeUsedCardSelect.prop('selectedIndex', 0);
}
}, 200);
});
Expand Down

0 comments on commit 0e086fe

Please sign in to comment.