posit-dev / posit-dev/py-shiny
cannot add widgets.Text to my ipyleaflet map
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 135
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 21
Description
I am creating a map using ipyleaflet and can add various widgets to the map using ipywidgets. However, when I add a widgets.Text to the map, the map disappears from the dashboard, though I do not see such behaviors outside of dashboard for a code like this:
import ipyleaflet as L
import ipywidgets as widgets
# Define the map
m = L.Map(center=(51.0, 0.0), zoom=5)
# Create a text widget
text_widget = widgets.Text(
value='',
placeholder='Type something',
description='Text Input:',
disabled=False
)
# Create a widget control and add it to the map
widget_control = L.WidgetControl(widget=text_widget, position='topright')
m.add_control(widget_control)
m
Here you can find the script for Pyshiny.
Contributor guide
No contributing guide indexed for this repository
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
Start by running the Python reproduction in the linked PyShiny editor, then compare the dashboard behavior with the same ipyleaflet and ipywidgets code outside the dashboard. Investigate why adding widgets.Text through WidgetControl makes the map disappear. Done means the map remains visible with the text control in the dashboard.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100