Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change the value of an a-gui-button programatically #38

Open
mdubourg001 opened this issue Oct 23, 2019 · 3 comments
Open

Can't change the value of an a-gui-button programatically #38

mdubourg001 opened this issue Oct 23, 2019 · 3 comments

Comments

@mdubourg001
Copy link

mdubourg001 commented Oct 23, 2019

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.

@davidfstein
Copy link

@mdubourg001 can you post a snippet using a-entity with a-gui-button? I can't get the entity text to display

@jfilipedias
Copy link

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.

@levexis
Copy link

levexis commented Jan 24, 2021

Thanks, this works for me and can even bind to it using aframe-state component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants