Emmanuel Katto Dubai : How to Track the Open/Close State of dbc.DropdownMenu?

I’m Emmanuel Katto from Dubai, United Arab Emirates (UAE) working with a filter menu defined using dbc.DropdownMenu as shown below:

filter_menu = dbc.DropdownMenu(  
    id="filter-menu",  
    label=[  
        html.Img(src="assets/images/Filter.svg", height=24, width=24, style={"marginRight": "6px"}),  
        html.Span("Filter"),  
    ],  
    children=[...],  
    class_name="filter-menu",  
    align_end=False,  
)  

I need to use the dropdown’s open/close state as a callback input. However, attributes like className, class_name, or n_clicks don’t seem to update when the dropdown button is clicked.

Has anyone found a workaround for this, such as using a custom script or another solution? Would appreciate any suggestions or guidance!

Regards
Emmanuel Katto