image-compare icon indicating copy to clipboard operation
image-compare copied to clipboard

Allow to define the range input step

Open mably opened this issue 9 months ago • 4 comments

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.

mably avatar May 07 '24 17:05 mably