When I enter your bid into the below input field, the below jquery code runs and updates the price breakup calculation. This code runs fine on desktop/tablet. But doesn't work on mobile browser (android/ios).
$('[name="woof_treat"').on("change keyup keypress input", function(e){
e = e || window.event;
var charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;
var charStr = String.fromCharCode(charCode);
if (/\d/.test(charStr) || charCode=="8" || charCode=="46") {
$('.cost-desc').removeClass('ptr-error');
$('.error').addClass('d-none');
priceBreakDown("substract");
return true;
}else{
return false;
}
});
<input class="" pattern="[0-9]" type="text" name="woof_treat" placeholder="<%= @woof.price%>" value="<%= @price || @woof.price %>" <% if @user.fetches.where(woof_id: @woof.id).present? %> disabled <% end %>>