diff --git a/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_table_card.dart b/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_table_card.dart index dc4a8e7f5d8..9c55aeb8691 100644 --- a/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_table_card.dart +++ b/packages/smooth_app/lib/cards/product_cards/knowledge_panels/knowledge_panel_table_card.dart @@ -274,13 +274,17 @@ class _TableCellWidgetState extends State { if (widget.cell.color != null) { style = style.apply(color: widget.cell.color); } - if (!widget.cell.isHeader || widget.cell.columnGroup!.columns.length == 1) { - return _buildHtmlCell(padding, style); + if (widget.cell.isHeader && widget.cell.columnGroup!.columns.length == 1) { + return _buildHtmlCell(padding, style, isSelectable: false); + } else if (!widget.cell.isHeader || + widget.cell.columnGroup!.columns.length == 1) { + return _buildHtmlCell(padding, style, isSelectable: true); } return _buildDropDownColumnHeader(padding, style); } - Widget _buildHtmlCell(EdgeInsets padding, TextStyle style) { + Widget _buildHtmlCell(EdgeInsets padding, TextStyle style, + {required bool isSelectable}) { String cellText = widget.cell.text; if (!_isExpanded) { const String htmlStyle = ''' @@ -301,6 +305,7 @@ class _TableCellWidgetState extends State { child: SmoothHtmlWidget( cellText, textStyle: style, + isSelectable: isSelectable, ), ), ), diff --git a/packages/smooth_app/lib/generic_lib/smooth_html_widget.dart b/packages/smooth_app/lib/generic_lib/smooth_html_widget.dart index e9ddc45704a..b5ffffeb660 100644 --- a/packages/smooth_app/lib/generic_lib/smooth_html_widget.dart +++ b/packages/smooth_app/lib/generic_lib/smooth_html_widget.dart @@ -4,10 +4,12 @@ import 'package:fwfh_selectable_text/fwfh_selectable_text.dart'; import 'package:smooth_app/helpers/launch_url_helper.dart'; class SmoothHtmlWidget extends StatelessWidget { - const SmoothHtmlWidget(this.htmlString, {this.textStyle}); + const SmoothHtmlWidget(this.htmlString, + {this.textStyle, this.isSelectable = true}); final String htmlString; final TextStyle? textStyle; + final bool isSelectable; @override Widget build(BuildContext context) { @@ -18,7 +20,8 @@ class SmoothHtmlWidget extends StatelessWidget { await LaunchUrlHelper.launchURL(url, false); return true; }, - factoryBuilder: () => SelectableHtmlWidgetFactory(), + factoryBuilder: () => + isSelectable ? SelectableHtmlWidgetFactory() : WidgetFactory(), enableCaching: false, ); }