Skip to content

fix: enable Shift+Click text selection#1548

Open
lustsazeus-lab wants to merge 1 commit intoMatterHackers:mainfrom
lustsazeus-lab:main
Open

fix: enable Shift+Click text selection#1548
lustsazeus-lab wants to merge 1 commit intoMatterHackers:mainfrom
lustsazeus-lab:main

Conversation

@lustsazeus-lab
Copy link

Summary

When Shift is held during mouse click in text fields, the Selecting flag was not being set to true, preventing text selection from being created.

Fix

Added logic to set Selecting = true when Shift+Click occurs, allowing users to select a range of text by:

  1. Clicking at the start position (without Shift)
  2. Holding Shift and clicking at the end position

This matches the expected behavior documented in the existing test TextSelectionWithShiftClick.

Changes

  • Gui/TextWidgets/InternalTextEditWidget.cs: Added else branch to set Selecting = true when Shift key is held during mouse down event.

Testing

The existing test TextSelectionWithShiftClick in Tests/Agg.Tests/Agg Automation Tests/TextEditTests.cs validates this functionality.

Closes #1411

When Shift is held during mouse click, the Selecting flag was not
being set to true, preventing the selection from being created.
This fix adds Setting Selecting = true when Shift+Click occurs,
allowing users to select a range of text by clicking at the start
position, then Shift+clicking at the end position.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant