mljar / mercury

Convert Jupyter Notebooks to Web Apps

Home Page:https://RunMercury.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

creating buttons in a loop is not working

DavoudTaghawiNejad opened this issue · comments

The following code:

menu = ['GDP', 'Sector', 'test']
buttons = {key: mr.Button(label=key, style="primary") for key in menu}

Should create three buttons below each other. Instead it produces only one key. Its not always consistant which one. (I suspect it cheats them on top of each other.

Hi @DavoudTaghawiNejad,
Please try to set unique url_key for each widget in the look, here is demo https://runmercury.com/examples/create-widgets-in-loop/