From 34ce6f2e9de043dede59edadd7d8d1b8e9c43fd6 Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Thu, 2 Nov 2023 16:52:36 -0400 Subject: [PATCH] Fix disabling selection on hyperlink clicks (#1093) --- NEWS.md | 2 ++ inst/htmlwidgets/datatables.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 1dfed348..94d30c7c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ - Upgraded DataTables version to 1.13.6 (thanks, @stla, #1091). +- Fixed disabling selection on hyperlink clicks (thanks, @guoci, #1093). + # CHANGES IN DT VERSION 0.30 - Fixed a bug that when using `updateSearch()`, the clear button inside the input box doesn't show up, and the table doesn't update when the input is cleared (thanks, @DavidBlairs, #1082). diff --git a/inst/htmlwidgets/datatables.js b/inst/htmlwidgets/datatables.js index d968d8be..9431d336 100644 --- a/inst/htmlwidgets/datatables.js +++ b/inst/htmlwidgets/datatables.js @@ -1372,7 +1372,7 @@ HTMLWidgets.widget({ changeInput('cell_clicked', {}); // do not trigger table selection when clicking on links unless they have classes - table.on('click.dt', 'tbody td a', function(e) { + table.on('mousedown.dt', 'tbody td a', function(e) { if (this.className === '') e.stopPropagation(); });