cuprite
cuprite copied to clipboard
BUG: select actions does not trigger "input" events (only "change" event) on select inputs/dropdowns
Context
When a user change/select the value (option) of a dropdown input :
<label for="test">Trigger events</label>
<select name="test" id="test">
<option>A</option>
<option>B</option>
</select>
<script>
const selectInput = document.getElementById('test');
selectInput.addEventListener('change', () => console.log('CHANGE EVENT TRIGGERED));
selectInput.addEventListener('input', () => console.log('input EVENT TRIGGERED));
</script>
in test:
select 'B', from:"Trigger events"
it does not trigger the input
event , but correctly triggers the change
event
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event
Looking at the code i think we are missing a line that also triggers a input
event in addition to that change
event
https://github.com/rubycdp/cuprite/blob/c7dc979350295f29630ad6dba35227c5d8a707fc/lib/capybara/cuprite/javascripts/index.js#L363-L380