jquery-bar-rating
jquery-bar-rating copied to clipboard
incorrect value on star clicked
Hello, sometimes (ramdomly) when someone clicks on a star, I recieve an incorrect value in onSelect event. My barrating: ` rtnValoracion.barrating({ theme: 'fontawesome-stars', onSelect:function(val, text, event){ if(esVoto){ ponerOverlay(true); var my_data = { action: 'if_votar_idea', id: $("#txtId").val(), nota: val };
jQuery.ajax({
method: "POST",
type: "json",
url: datos.ajax_url,
data: my_data,
success: function(msg){
var respuesta = JSON.parse(msg);
debug.log(respuesta);
if(respuesta.ok){
actualizarCeldaGrid(my_data.id, 'media_html', respuesta.html_nota);
actualizarCeldaGrid(my_data.id, 'num_votos', respuesta.votos.num_votos);
actualizarCeldaGrid(my_data.id, 'num_usuarios', respuesta.votos.num_usuarios);
grid.trigger( 'reloadGrid' );
divDialog.html("<p>Voto guardado</p>");
rtnValoracion.barrating('readonly', true);
}
else{
divDialog.html("<p>Error votando</p>");
}
ponerOverlay(false);
divDialog.dialog("open");
},
error: function(error){
errorAjax(error);
},
fail: function(error){
errorAjax(error);
}
});
}
}
});`
val parameter sometimes give me an empty string instad of a numeric value between 1 and 5.
edit: sorry for the format, I don't know how to sanitize styles text here.
I have the same issue, but it is more consistent. When the user selects a star rating that is filled, then the star value is not passed. For eg: say the existing star rating is 4 stars. If the user clicks on the 4th star again, no value is passed. If there is a fractional value (using fontawesome-star-o theme), then there is no issue. it is only on full star value.
I detected that firefox causes more problems that other browsers...
Not just firefox, I have this on Chrome and Edge too!
Yes, but in my case Firefox has more problems that the others browsers :( (sorry for my English)
Sooo...no one wants to fix this?!