[BUG] ctx.triggered_id is not recognized as a dict
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
Describe your context
Please provide us your environment, so we can easily reproduce the issue.
dash 4.4.1
dash_ag_grid 35.3.0
dash-extensions 2.0.6
dash-iconify 0.1.2
dash_mantine_components 2.8.0
Describe the bug
I am defining multiple dynamic components and set their id like this:
id={"type": "entry", "index": id},
where the value of "index" gets changed depending on the component.
Now, when I want to use the id in a pattern-matching callback, I need to get the value of "index"to search a sqlite database. When I use
ctx.triggered_id.get("index"))
however, VS Code produces an error and says: ""get" is no known attribute of "None"". The call however correctly returns the value of "index"
The same problem happens with ctx.triggered_id["index"], although the error then says: "None" object is not subscriptable.
FYI: I translated the error messages from German to English. They could be slightly inaccurate, though their meaning should be correct
Expected behavior
I would expect it to see a dict as a possible type of triggered_id, so that there is no error shown.
Contributor guide
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
The issue names no source file or test; start at the Python definition of ctx.triggered_id and the callback-context typing. Reproduce pattern-matching access with the listed Dash versions, then verify that static analysis permits dictionary access while the no-trigger case remains represented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 63/100