image-compare
image-compare copied to clipboard
Allow to define the range input step
We are currently adding it as a custom step
attribute to the image-compare
element:
<image-compare step="5" ...
And then activate it after page load using some code similar to this:
once('image_compare', 'image-compare', context).forEach(function (element) {
var range_input = element.shadowRoot.querySelector('input');
if (range_input && parseInt(element.getAttribute('step')) > 1) {
range_input.step = element.getAttribute('step');
}
});
Could improve keyboard use in some cases.