Open johnpearson555 opened 5 years ago
I had the same issue, buddy. I followed 2 steps to get things working. But while editing this post, I realized that the 2º step (oninput event) is not necessary if you put a var before the outputs variable.
First, edit the findOutputForSlider function as follow (Otherwise, you might get "Uncaught ReferenceError: outputs is not defined" as response):
function findOutputForSlider( element ) {
var idVal = element.id;
var outputs = document.getElementsByTagName( 'output' );
for( var i = 0; i < outputs.length; i++ ) {
if ( outputs[ i ].htmlFor == idVal )
return outputs[ i ];
}
}
Secondly, we need (not really) an oninput event to get the values updated:
<input id="sliderWithValue"
class="slider has-output is-fullwidth" min="0" max="100" value="50" step="1" type="range"
oninput="output.value="sliderWithValue.value">
<output for="sliderWithValue">50</output>
Still, I have 2 more issues going on:
Do not use built-in or reserved HTML elements as component id: output
I tried this according to this issue: https://github.com/Wikiki/bulma-slider/issues/21#issuecomment-435379581
But I can't get it working:
What am I doing wrong?
Thanks!