aframe-speech-command-component icon indicating copy to clipboard operation
aframe-speech-command-component copied to clipboard

How to set the speech-command attribute dynamically?

Open pjoulot opened this issue 8 years ago • 0 comments

Hello,

The name chosen for the attribute of the component is 'speech-command' but the character '-' seems blocking the setAttribute method. When you try something like the code below, Firefox and Chrome set the attribute with an empty value because of the '-'.

tag.setAttribute('speech-command__open', 'custom command');

Replacing '-' by '_' corrects the problem (I don't know why), but I'm not sure that is the best solution. The component works very well when the attribute is set directly in the HTML, but is there any solution to add the attribute dynamically in JS?

Thank you for reading this.

pjoulot avatar May 09 '17 23:05 pjoulot