Skip to content

Commit

Permalink
Fix issues with making Button linkable (#5641)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Oct 15, 2023
1 parent 321a10e commit db1e9fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 0 additions & 7 deletions panel/widgets/_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,3 @@ def _process_param_change(self, params) -> dict[str, Any]:
if isinstance(desc, str):
params['description'] = BkTooltip(content=desc, position='right')
return super()._process_param_change(params)

@property
def _linkable_params(self) -> tuple[str]:
props = list(super()._linked_properties)
if 'description' in props:
props.remove('description')
return tuple(props)
6 changes: 5 additions & 1 deletion panel/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ class Button(_ClickButton, TooltipMixin):
'clicks': None, 'name': 'label', 'value': None,
}

_source_transforms: ClassVar[Mapping[str, str | None]] = {
'button_style': None, 'description': None
}

_target_transforms: ClassVar[Mapping[str, str | None]] = {
'event:button_click': None, 'value': None
'event:button_click': None, 'value': None,
}

_widget_type: ClassVar[Type[Model]] = _BkButton
Expand Down
5 changes: 3 additions & 2 deletions panel/widgets/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class RadioButtonGroup(_RadioGroupBase, _ButtonBase, TooltipMixin):
Button group orientation, either 'horizontal' (default) or 'vertical'.""")

_source_transforms = {
'value': "source.labels[value]", 'button_style': None
'value': "source.labels[value]", 'button_style': None, 'description': None
}

_supports_embed: ClassVar[bool] = True
Expand Down Expand Up @@ -675,7 +675,8 @@ class CheckButtonGroup(_CheckGroupBase, _ButtonBase, TooltipMixin):
Button group orientation, either 'horizontal' (default) or 'vertical'.""")

_source_transforms = {
'value': "value.map((index) => source.labels[index])", 'button_style': None
'value': "value.map((index) => source.labels[index])", 'button_style': None,
'description': None
}

_widget_type: ClassVar[Type[Model]] = _BkCheckboxButtonGroup
Expand Down

0 comments on commit db1e9fe

Please sign in to comment.