-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix auto select in InspectDataMenu when opened above cursor (#691)
This PR addresses an issue where the inspector context menu automatically selects and closes upon appearing above the cursor. The problem was caused by the menu opening upon mouseUp immediately after a mouseDown event. The solution ensures the menu displays adjacent to the cursor with an offset by introducing a `span` that positions the `Trigger` component at the mouse location, ensuring the menu opens next to the `Trigger`. Additionally, this PR: - limits the number of inspect items displayed in `InspectDataMenu` to 5 using `MAX_INSPECT_ITEMS` - adds a "Show all" button to reveal all items - adds ellipsis truncation for long filenames in `InspectDataMenu` - adjusts menu alignment based on cursor position, displaying to the right if the cursor is on the left side of the screen and to the left if on the right Fixes #687 ### How Has This Been Tested: - Tested by right-clicking near the screen's bottom, ensuring the menu opens above the cursor and doesn't auto-select any items. After: <img width="239" alt="Screenshot 2024-11-04 at 20 39 32" src="https://github.com/user-attachments/assets/ec95ac31-0204-4d65-91c7-c40d297421d9"> <img width="386" alt="Screenshot 2024-11-05 at 18 33 04" src="https://github.com/user-attachments/assets/423ff8eb-1416-4ee2-a2ea-824be2ff7faf"> https://github.com/user-attachments/assets/b09a6fdb-23a6-4ecd-b707-980f7074a652
- Loading branch information
Showing
2 changed files
with
103 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters