-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing incorrect scroll to element obscured by sticky element (#8047)
## Purpose Actions doesn't scroll correctly to element behind a sticky element ## Approach Added function which check element on property sticky. Made refactor in scroll action ## References [issue 7377](#7377) ## Pre-Merge TODO - [x] Write tests for your proposed changes - [x] Make sure that existing tests do not fail
- Loading branch information
1 parent
4d14d66
commit 21b44a0
Showing
5 changed files
with
66 additions
and
5 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
35 changes: 35 additions & 0 deletions
35
test/functional/fixtures/regression/gh-7377/pages/index.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<style> | ||
.spacer { | ||
height: 100vh; | ||
} | ||
|
||
.sticky-footer { | ||
position: sticky; | ||
bottom: 0; | ||
background: #fff; | ||
border-top: 2px solid #e9ecef; | ||
padding: 1.5rem 0.25rem; | ||
background-color: #2c59859c; | ||
} | ||
</style> | ||
<form> | ||
<section> | ||
<header class="spacer">Section A</header> | ||
<br><br> | ||
<div class="field"> | ||
<div id="input"><label>Input</label> <input type="text"></div> | ||
</div> | ||
</section> | ||
|
||
<footer class="sticky-footer"> | ||
<button> save </button> | ||
</footer> | ||
</form> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('[Regression](GH-7377)', () => { | ||
it('Should scroll element higher than sticky footer and type text in element', async () => { | ||
return runTests('./testcafe-fixtures/'); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
test/functional/fixtures/regression/gh-7377/testcafe-fixtures/index.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture `fixture` | ||
.page `http://localhost:3000/fixtures/regression/gh-7377/pages/index.html`; | ||
|
||
const input = Selector('#input').find('input'); | ||
|
||
|
||
test('Should scroll to the input and enter text into it', async (t) => { | ||
await t.typeText(input, 'test'); | ||
await t.expect(input.value).eql('test'); | ||
}); |