aframe-gui
aframe-gui copied to clipboard
Can't change the value of an a-gui-button programatically
I have a button in my index.html:
<a-gui-button id="button" value="Hello"></a-gui-button>
Trying to change its value as following has no effect:
const button = document.querySelector('#button');
button.setAttribute('value', 'Goodbye');
Edit: The actual workaround I'm using it to put a custom text component (<a-entity text="" />) inside the button and edit it when I need.
@mdubourg001 can you post a snippet using a-entity with a-gui-button? I can't get the entity text to display
Hello guys, I saw this problem when I was trying to use the button component. I opened this pull request to fix this problem. Now it's just wait for some review.
Thanks, this works for me and can even bind to it using aframe-state component.