Skip to content

Setting a new min/max value for a numeric slider causes an exception #47

@bmckalla

Description

@bmckalla

When trying to update a numeric slider (only tested on IntRangeSlider) and the min or max value is update, it causes a traitlets.traitlets.TraitError.

Case where new min > current max:

Reacton.slider.issue.-.pt.1.mov

The order of the attributes being input set seems to mitigate the issue:

Reacton.slider.issue.-.pt.2.mov

But if you update to a different value, it can still break. Case where new max < current min:

Reacton.slider.issue.-.pt.3.mov

I would think these lines would handle catching that?

reacton/reacton/core.py

Lines 1980 to 1985 in 51e6eda

try:
el._update_widget(widget_previous, el_prev, kwargs)
except BaseException as e:
context.exceptions_self.append(e)
self._rerender_needed_reasons.append(RerenderReason(reason="Exception ocurred during reconciliation (updating widget)"))
self._rerender_needed = True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions