Trigger RangeInput on keyup

I’m trying to trigger RangeInput elements (.ais-RangeInput-input) on keyup. Right now, a customer either has to tab enter, or use the submit button. We are hiding the button for appearance preferences, so only via Enter is currently possible.

I tried a few things to manually trigger either a submit event on the parent forms itself, or by triggering a click even on the (hidden) button. Nothing seems to work.

Here is the part I’m talking about: Screenshot 2024-04-26 at 16.43.10

Anybody got an idea if it’s even possible to do a search on a RangeInput with keyup (after a setTimeout of ~500ms)? Any help is much appreciated.

You can create a new KeyboardEvent and dispatch it on the RangeInput element. In this example, we’re dispatching a keyup event with the “Enter” key. Official Site Adjust the key according to your requirements.

const rangeInput = document.querySelector(‘.ais-RangeInput-input’); // Replace with your actual selector
const keyupEvent = new KeyboardEvent(‘keyup’, { key: ‘Enter’ }); // Customize the key as needed
rangeInput.dispatchEvent(keyupEvent);

Didn’t work, but thanks anyway. I found a solution. Your comment looks kind of spammy with the “Official Site” link. :thinking: