1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-05 15:16:07 +02:00

Updated scrolling logic (#343)

This commit is contained in:
Tim Voronov 2019-08-01 20:27:26 -04:00 committed by GitHub
parent 27a74cd398
commit 2ba68ebf00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,9 @@
## Changelog ## Changelog
### 0.8.2
#### Fixed
- Scrolling position is not centered.
### 0.8.1 ### 0.8.1
#### Fixed #### Fixed
- Added existence check to ``CLICK`` and ``CLICK_ALL`` functions. [#341](https://github.com/MontFerret/ferret/pull/341) - Added existence check to ``CLICK`` and ``CLICK_ALL`` functions. [#341](https://github.com/MontFerret/ferret/pull/341)

View File

@ -42,6 +42,8 @@ const (
if (!isInViewport(el)) { if (!isInViewport(el)) {
el.scrollIntoView({ el.scrollIntoView({
block: 'center',
inline: 'center',
behavior: 'instant' behavior: 'instant'
}); });
} }
@ -81,6 +83,8 @@ func ScrollIntoViewBySelector(selector string) string {
if (!isInViewport(el)) { if (!isInViewport(el)) {
el.scrollIntoView({ el.scrollIntoView({
block: 'center',
inline: 'center',
behavior: 'instant' behavior: 'instant'
}); });
} }