Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form widgets label_map doesn't work as expected #12

Closed
adigitoleo opened this issue Apr 26, 2021 · 1 comment · Fixed by #13
Closed

Form widgets label_map doesn't work as expected #12

adigitoleo opened this issue Apr 26, 2021 · 1 comment · Fixed by #13

Comments

@adigitoleo
Copy link

adigitoleo commented Apr 26, 2021

The label_map argument for Form and FormDialog doesn't work: You are trying to subscribe to the label instead of the actual key.

import pathlib as p

import edifice as ed
from edifice.components.forms import Form

form_data = ed.StateManager(
    {
        "Value 1": p.Path(""),
        "Value 2": "Some text",
        "Value 3": 4.2,
    }
)

labels = {
    # Uncommenting the second or third label causes a KeyError.
    "Value 1": "First value",
    # "Value 2": "Second value",
    # "Value 3": "Third value",
}

ed.App(ed.Window()(Form(form_data, label_map=labels))).start()
print(form_data.as_dict())
@adigitoleo adigitoleo mentioned this issue May 3, 2021
@fding
Copy link
Member

fding commented May 3, 2021

Thanks for noticing this bug and the fix!

@fding fding closed this as completed in #13 May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants