Range input not UI does not update until directly interacted with
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.3k
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
Version: yo-yo@latest browserified and running in Chrome 55.0. Works as expected in Firefox.
Expected behavior: when yo-yo updates range input attributes, the UI updates to match even before you've interacted with the range input directly.
Observed behavior: the range input value attribute is updated via yo.update, but the UI does not change to match. However, once I've directly dragged the range input, the same update does change the UI.

Live example (nearly identical to video; slightly simplified): http://codepen.io/rsreusser/pen/vyPKbg?editors=1010
Code to reproduce:
var yo = require('yo-yo');
var makeSlider = value => yo`
<div>
<input type="range" min="0" max="100" value="${value}">
<input type="number" id="number" min="0" max="100" value="${value}">
</div>
`;
var slider = makeSlider(50);
document.body.append(slider);
document.getElementById('number').addEventListener('input', function (e) {
yo.update(slider, makeSlider(e.target.value));
});
Analysis: It's not clear to me whether this is a morphdom issue, a yo-yo issue, a browser issue, or my issue, but I've narrowed things down to behavior that doesn't make sense to me. I fear the answer is: All of the pieces are functioning as intended and this is simply one of those weird browser quirks that fits into an "undefined behavior" sort of gap. 😄
References (of questionable relevance):
- This seems similar: patrick-steele-idem/morphdom#88
- Ditto: yoshuawuyts/choo#253
- This hints that the cause of this feature may be rigorous adherence to specs (combined with my lack of knowledge of the specs): Input range thumb do not refreshes after changed max value
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Chrome reproduction and compare its range-input behavior with Firefox. Trace the yo.update path and the referenced morphdom behavior, then verify that updating the range value changes the visible control before direct interaction without regressing the number input case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100