Skip to content

[BUG] ctx.triggered_id is not recognized as a dict #3968

Description

@ProfessorOwl

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions