From aa64ac8f7b8e200e07af05c88b5f45d9a2b560db Mon Sep 17 00:00:00 2001 From: mollykreis <20542556+mollykreis@users.noreply.github.com> Date: Tue, 1 Aug 2023 19:02:12 -0500 Subject: [PATCH] Fix table bug where shift-selecting rows would highlight all cell content (#1408) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request ## ๐Ÿคจ Rationale Fix a bug in the `nimble-table` where shift-selecting rows would incorrectly highlight all cell content within the selection range. ## ๐Ÿ‘ฉโ€๐Ÿ’ป Implementation Mark `documentShiftKeyDown` as `@observable` on the `Table`. This appears to have been accidentally removed in #1321. ## ๐Ÿงช Testing Manually tested that shift-selecting rows no longer selects the text in cells. ## โœ… Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. --- ...le-components-40354720-a6bd-433f-a845-772c70bb5180.json | 7 +++++++ packages/nimble-components/src/table/index.ts | 1 + 2 files changed, 8 insertions(+) create mode 100644 change/@ni-nimble-components-40354720-a6bd-433f-a845-772c70bb5180.json diff --git a/change/@ni-nimble-components-40354720-a6bd-433f-a845-772c70bb5180.json b/change/@ni-nimble-components-40354720-a6bd-433f-a845-772c70bb5180.json new file mode 100644 index 0000000000..c00994e639 --- /dev/null +++ b/change/@ni-nimble-components-40354720-a6bd-433f-a845-772c70bb5180.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fix table bug where shift-selecting rows would highlight all cell content", + "packageName": "@ni/nimble-components", + "email": "20542556+mollykreis@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/nimble-components/src/table/index.ts b/packages/nimble-components/src/table/index.ts index 97278ec870..c468201095 100644 --- a/packages/nimble-components/src/table/index.ts +++ b/packages/nimble-components/src/table/index.ts @@ -198,6 +198,7 @@ export class Table< @observable public tableScrollableMinWidth = 0; + @observable public documentShiftKeyDown = false; private readonly table: TanStackTable;