Increment/Decrement uses the value of the first input

Open
#443 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start with the HTML reproduction and the linked JSFiddle, focusing on the increment and set commands applied to the input selection. Verify the behavior by clicking each span and checking whether inputs receive distinct values while the closest input resets to 0; done means the example no longer synchronizes every input to the first value.

Written by the indexing model from the issue text.

Description

bug

On a click action and want to increment values of all inputs and reset the closest input to 0.

I created a fiddle to demonstrate:
https://jsfiddle.net/oj6c53bt/1/

I expect all inputs to have unique values at some point, but all values are synced with the first input of the selection.

<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://unpkg.com/hyperscript.org@0.9.8"></script>

</head>
<body>
    <span _="on click
          increment the value of <input/>
          set the value of the next <input/> to 0">Click me third</span>
    <input type="number"
          value="0"/>
  <br/>
    <span _="on click
          increment the value of <input/>
          set the value of the next <input/> to 0">Click me second</span>
    <input type="number"
          value="0"/>
  <br/>
    <span _="on click
          increment the value of <input/>
          set the value of the next <input/> to 0">Click me first</span>
    <input type="number"
          value="0"/>
</body>
</html>
Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.