PromucFlow_constructor/app/client/src/layoutSystems/anvil/canvas
Abhinav Jha 55487f5865
fix: Deselect all widgets on canvas click (#31653)
## Description
Clicking on the canvas in Anvil layouts did not deselect all widgets.
This PR fixes it. Now all widgets

## Approach
In the `AnvilMainCanvas` we check if the origin of the click event is
the Main Canvas. If it is, we allow the function to deselect all widgets
to run.

## Automation

/ok-to-test tags="@tag.Anvil"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Refactor**
- Improved the logic for clearing widget selections to enhance user
experience when interacting with the main canvas.
- **Tests**
- Added a test case to ensure clicking on the canvas deselects all
widgets and verifies the border color of widgets within the main canvas.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-11 20:45:47 +05:30
..
AnvilCanvas.tsx feat: Asymmetric padding in Anvil (#30964) 2024-02-16 17:13:37 +05:30
AnvilMainCanvas.tsx fix: Deselect all widgets on canvas click (#31653) 2024-03-11 20:45:47 +05:30
styles.css fix: fix modal position and styles (#30805) 2024-02-06 10:26:47 +03:00
types.ts chore: Add MutuationObserver to track changes in positions of widgets and layouts. (#28315) 2023-10-24 07:37:06 -04:00
useClickToClearSelections.ts fix: Deselect all widgets on canvas click (#31653) 2024-03-11 20:45:47 +05:30
utils.ts chore: add highlight calculation logic for layouts. (#27980) 2023-10-19 16:27:40 -04:00