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

Do not override widget class if already specified by user #1301

Merged
merged 1 commit into from
Apr 26, 2020

Conversation

poplarShift
Copy link
Contributor

@poplarShift poplarShift commented Apr 26, 2020

Following the discussions in #1128, I discovered that providing the widgets dict currently did not allow specifying it for param.Number:

import param 
import panel as pn
pn.extension()

class T(param.Parameterized):
    a = param.Number(default=None)
t = T(a=1e-3)
    
pn.Pane(t.param, widgets={
    'a': pn.widgets.LiteralInput()
}) # falls back to Spinner no matter what

The reason was that param.Number was handled as a special case and actually overridden once again if no bounds are provided.

This PR simply adds another quick check and forces panel to roll with the user-supplied widgets, if provided, even for param.Number.

@philippjfr
Copy link
Member

Thanks @poplarShift.

@philippjfr philippjfr merged commit 5282159 into holoviz:master Apr 26, 2020
philippjfr pushed a commit that referenced this pull request Jun 19, 2020
…#1301)

Co-authored-by: poplarShift <poplarShift@users.noreply.github.com>
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 this pull request may close these issues.

None yet

3 participants