-
Notifications
You must be signed in to change notification settings - Fork 3.3k
internal: fix assertion menu not displayed in the correct location #32172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+84
−5
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
983be50
handle 0 offsets for selector highlight styles
mabela416 7926e6c
use the child element for the rest of the calculations
mabela416 479227f
add test
mabela416 8ac42f8
add percy snapshot
mabela416 01ff26a
does the placement of the percysnapshot show the menu?
mabela416 3b2013e
assert position of the menu
mabela416 86baec7
Merge branch 'release/15.0.0' into mabel/issue-11216-menu-location
mabela416 7af0b2a
Merge branch 'release/15.0.0' into mabel/issue-11216-menu-location
mabela416 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
35 changes: 35 additions & 0 deletions
35
system-tests/projects/experimental-studio/cypress/e2e/invisible-wrapper.html
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Hello Studio</title> | ||
</head> | ||
|
||
<body> | ||
<script> | ||
let count = 0 | ||
|
||
function increment() { | ||
count++ | ||
document.querySelector('p').innerText = `Count is ${count}` | ||
} | ||
</script> | ||
|
||
<h1>Hello, Studio!</h1> | ||
<hr /> | ||
|
||
<p>Count is 0</p> | ||
<button onclick="increment()" id="increment"> | ||
<div style="width: 0; height: 0; display: contents;"> | ||
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M4 2V6M6 4H2" stroke="#5A5F7A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> | ||
</svg> | ||
Increment | ||
</div> | ||
</button> | ||
</body> | ||
|
||
</html> |
5 changes: 5 additions & 0 deletions
5
system-tests/projects/experimental-studio/cypress/e2e/spec-w-invisible-wrapper.cy.js
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('studio functionality', () => { | ||
it('visits a basic html page with an invisible wrapper', function () { | ||
cy.visit('cypress/e2e/invisible-wrapper.html') | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Highlight Styling Fails with Child Elements
The
getSelectorHighlightStyles
function has two issues: it inconsistently uses element properties, and its child offset detection condition is flawed. When a child element's offset is used for positioning, the function still uses the parent element's dimensions, transform, and z-index, resulting in highlight boxes positioned at the child's location but sized and styled according to the parent. Additionally, the conditionoffset.top === 0 && offset.left === 0
is too broad, incorrectly triggering the child offset logic for elements legitimately at (0,0) and causing mispositioned highlights.