Current event handlers is not setting or giving the value
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start by reproducing the supplied HTML and _hyperscript handler with multiple country selects. Inspect how set value of me and document.activeElement are resolved during the change event. Done means the duplicate-country alert still appears and the affected select resets to Select Country without relying on document.activeElement.
Written by the indexing model from the issue text.
Description
Thank you carson and community
I have multiple select fields to select countries, if the user selects the same country in another select field then I show an alert and then set the value of that select field to default value.
<div
_="on every change in .country-select
set currentCountries to value of .country-select
set alreadySetCountries to []
repeat for country in currentCountries
if country is in alreadySetCountries
alert(`This country has already been selected`)
set value of document.activeElement to 'Select Country'
end
append country to alreadySetCountries
end
"
>
<select class="select country-select" autocomplete="country" id="country" name="country">
<option>Select Country</option>
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="DZ">Albania</option>
...
</select>
<select class="select country-select" autocomplete="country" id="country" name="country">
<option>Select Country</option>
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
...
</select>
...
</div>
I have to use document.activeElement in the above code to set or receive values because set value of me to 'Select Country' is not working.
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·