posit-dev / posit-dev/py-shiny

cannot add widgets.Text to my ipyleaflet map

Open
#583 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.