cuprite icon indicating copy to clipboard operation
cuprite copied to clipboard

Setting a color input doesn't fire the change or input events

Open asilano opened this issue 2 years ago • 0 comments

Given HTML like:

<input type="color" id="control" onchange="document.getElementById('monitor').innerHTML = 'changed'"/>
<div id="monitor"></div>

Then the following test will fail:

fill_in("control", with: "#c0ffee")
expect(page).to have_content("changed")

This is because the set method for a color input only forces the value via JavaScript; it doesn't trigger the change or input events.

I have a fix for this; PR incoming.

asilano avatar Apr 17 '23 16:04 asilano