Skip to content

Commit

Permalink
Fix cmd + A selecting the device image (#437)
Browse files Browse the repository at this point in the history
This PR hides, device selection that happens when user presses cmd + A. 

This change is required because the user-select css property is not
inheritable, which is why it does not disable global selection (using
ctrl + A or double-click).
 
Fixes: #434

---------

Co-authored-by: filip131311 <[email protected]>
  • Loading branch information
filip131311 and filip131311 authored Jul 11, 2024
1 parent 98d0ca0 commit 31abba2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vscode-extension/src/webview/components/Preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
height: var(--phone-screen-height);
top: var(--phone-top);
left: calc(var(--phone-left) - 7px);
user-select: none;
}

.phone-sized {
Expand All @@ -42,6 +43,7 @@
mask-image: var(--phone-mask-image);
-webkit-mask-size: cover;
mask-size: cover;
user-select: none;
}

.phone-screen {
Expand All @@ -54,6 +56,7 @@
mask-image: var(--phone-mask-image);
-webkit-mask-size: cover;
mask-size: cover;
user-select: none;
}

.phone-frame {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function useResizableProps({
...resizableStyle,
display: phoneHeight === 0 ? "none" : "flex",
alignItems: "center",
userSelect: "none",
},
handleStyles: {
bottomRight: {
Expand Down

0 comments on commit 31abba2

Please sign in to comment.