SathvikGanta commited on
Commit
0a4873f
·
verified ·
1 Parent(s): f4968fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -19,6 +19,9 @@ with gr.Blocks(css="styles.css") as app:
19
  """
20
  )
21
 
 
 
 
22
  # Display all items as a vertical list
23
  with gr.Column(elem_id="food-list"):
24
  for food_name in FOOD_DATA.keys():
@@ -29,12 +32,11 @@ with gr.Blocks(css="styles.css") as app:
29
  ).click(
30
  display_card,
31
  inputs=[gr.Textbox(value=food_name, visible=False)],
32
- outputs="popup-content" # Update the popup content dynamically
33
  )
34
 
35
- # Popup container
36
- with gr.HTML(elem_id="popup-container", visible=True):
37
- gr.HTML(value="", elem_id="popup-content") # Placeholder for popup content
38
 
39
  # Launch the app
40
  app.launch()
 
19
  """
20
  )
21
 
22
+ # Create a hidden popup area
23
+ popup_area = gr.HTML(visible=False)
24
+
25
  # Display all items as a vertical list
26
  with gr.Column(elem_id="food-list"):
27
  for food_name in FOOD_DATA.keys():
 
32
  ).click(
33
  display_card,
34
  inputs=[gr.Textbox(value=food_name, visible=False)],
35
+ outputs=popup_area, # Reference the popup HTML component
36
  )
37
 
38
+ # Add the popup area to the app
39
+ popup_area.style()
 
40
 
41
  # Launch the app
42
  app.launch()