jquery-bar-rating icon indicating copy to clipboard operation
jquery-bar-rating copied to clipboard

incorrect value on star clicked

Open miguelangelss4 opened this issue 8 years ago • 5 comments

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.

miguelangelss4 avatar Mar 01 '17 11:03 miguelangelss4

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.

m-faraz avatar Jun 21 '18 07:06 m-faraz

I detected that firefox causes more problems that other browsers...

miguelangelss4 avatar Jun 21 '18 08:06 miguelangelss4

Not just firefox, I have this on Chrome and Edge too!

m-faraz avatar Jun 21 '18 10:06 m-faraz

Yes, but in my case Firefox has more problems that the others browsers :( (sorry for my English)

miguelangelss4 avatar Jun 21 '18 10:06 miguelangelss4

Sooo...no one wants to fix this?!

m-faraz avatar Jul 31 '18 06:07 m-faraz