From db1e9fe1b17258d3690a80546328b202dff06f9b Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sun, 15 Oct 2023 21:37:26 +0200 Subject: [PATCH] Fix issues with making Button linkable (#5641) --- panel/widgets/_mixin.py | 7 ------- panel/widgets/button.py | 6 +++++- panel/widgets/select.py | 5 +++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/panel/widgets/_mixin.py b/panel/widgets/_mixin.py index e3783efebc..f47607639d 100644 --- a/panel/widgets/_mixin.py +++ b/panel/widgets/_mixin.py @@ -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) diff --git a/panel/widgets/button.py b/panel/widgets/button.py index 789f94a680..145387cf96 100644 --- a/panel/widgets/button.py +++ b/panel/widgets/button.py @@ -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 diff --git a/panel/widgets/select.py b/panel/widgets/select.py index 3a92f15c2e..e7067d06d3 100644 --- a/panel/widgets/select.py +++ b/panel/widgets/select.py @@ -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 @@ -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