onChange not being called on List when entry is already selected
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Locate the List component implementation and trace the entry-click path that decides selection state, comparing where onChange fires for selection versus deselection. The issue names onChange and the private _onEntryClick, but not a file, so start by searching the repository for those identifiers. Reproduce with the supplied view:AddList snippet; done means clicking an already-selected entry invokes onChange with selected false and the same event contract as selection.
Written by the indexing model from the issue text.
Description
I'm trying to use the List but one issue I'm hitting is that onChange isn't being called when the entry is already selected (to do a deselect). Not sure why, but here's a snippet of the code that I have:
view:AddList({
maxSelected = #Regions.LIST,
entries = entries,
_onEntryClick = function(_, id, selected)
log("onentry")
end,
onChange = function(_, id, selected, eventType)
log("onchange")
end,
})
The _onEntryClick does fire when I click on an already selected entry so that works as a workaround for now, but it's a private method so not great to use. It looks like onChange should be called on a deselection too based on the List code.
- Dominant language
- Lua
- Stars
- 6
- Forks
- 4
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 18
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 PrettyRS/prettyui
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PrettyRS/prettyui#15 · 4 comments ·
Maintainers usually reply within 1 day
All issues in PrettyRS/prettyui
Similar issues
-
bug confirmed discord guide:tyrs-watch locale:enUS navigation v0.3.2
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
fitzforge/polestar#855 · 1 comment ·
Maintainers usually reply within 1 day
-
translation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
KristanLaimon/PanelsPlus#16 ·
-
Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
DennisRas/WeeklyKnowledge#164 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day