set a (same) class to a next element using the class to find the first element
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start from the issue's hyperscript snippet and the documented (next|previous) <css expression> [from <expression>] [within <expression>] syntax. Reproduce the .selected and #selected variants, then compare the expression and DOM-reference behavior; done means the documented syntax and a hyperscript way to identify or update the selected list item are clarified.
Written by the indexing model from the issue text.
Description
Hello,
I have a input field and a list. the input field contains script.
When the input field is changed, the list will shift the selected class to the next element. Snippet code example:
<div id="activePart"><input
script="on keyup
if the event's key is 'ArrowDown' then
...
add .selected to the next <li/> from .selected within #autoCompleteCustomer
end">
</div>
<div>
<ul>
<li class='selected'></li><li></li><li></li>
</ul>
</div>
This isn't working. Due to the from .selected
my understanding from thr docs:
(next|previous) <css expression> [from <expression>] [within <expression>] [with wrapping]
is that after the from an expression is allowed to defined a starting point other that me wich is the input field and not usable.
Also my understanding of expression can be anything as from the doc:
Others are a bit more exotic and, for example, make it easy to work with the DOM:
ID References: #foo
Class References: .tabs
Query References: <div/>
Attribute References: @count
I tried to use something else like adding ID (hacking on a li the id via console) as reference and then the line works:
add .selected to the next <li/> from #selected within #autoCompleteCustomer
However, I cannot seem to find the way to add an ID=selected via hyperscript.
So I am stuck.
Could you help me to clarify what the document now means concerning expression and if it is possible to add an id via hyperscript?
thanks in advance
- 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
- 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.
More from bigskysoftware/_hyperscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/_hyperscript#676 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bigskysoftware/_hyperscript#695 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
bigskysoftware/_hyperscript#687 ·
All issues in bigskysoftware/_hyperscript
Similar issues
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 90/100