aframe-gui icon indicating copy to clipboard operation
aframe-gui copied to clipboard

'checked' property of a-gui-radio not updating

Open mauriciomartinez-itesm opened this issue 7 years ago • 1 comments

I can't get a-gui-radio to send me the change of value of 'checked' it always sends true

HTML

<a-gui-flex-container position="${position}" width=".1" height=".1" scale="1 1 1" rotation="${rotation}" opacity="0">
            <a-gui-radio 
                width=".4" height=".2"
                onclick="addCart(this)" 
                value="🛒"
                font-family="Arial"
                font-size=30px
                margin="0 0 0.05 0"
                opacity="0"
                active-color="#009900"
                background-color="#d3d3d3"
                handle-color="#333333"
                border-color="#999999"
                hover-color="#AAAAAA"
                extra=false
            >
            </a-gui-radio>
</a-gui-flex-container>

JS

function addCart(_this){

	var checked = _this.getAttribute("checked");

	if(checked){
		var audio1 = document.querySelector('#addCartAudio');
        audio1.components.sound.playSound();
	}else{
		var audio2 = document.querySelector('#removeCartAudio');
        audio2.components.sound.playSound();
	}

	_this.setAttribute("checked", !_this.getAttribute("checked"));
}

mauriciomartinez-itesm avatar Sep 27 '18 21:09 mauriciomartinez-itesm

@lmalave could you check if this is still an issue please

rdub80 avatar Jul 03 '20 18:07 rdub80