mirror of
https://github.com/MontFerret/ferret.git
synced 2025-08-15 20:02:56 +02:00
Updated scrolling logic (#343)
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
## Changelog
|
||||
|
||||
### 0.8.2
|
||||
#### Fixed
|
||||
- Scrolling position is not centered.
|
||||
|
||||
### 0.8.1
|
||||
#### Fixed
|
||||
- Added existence check to ``CLICK`` and ``CLICK_ALL`` functions. [#341](https://github.com/MontFerret/ferret/pull/341)
|
||||
|
@@ -42,6 +42,8 @@ const (
|
||||
|
||||
if (!isInViewport(el)) {
|
||||
el.scrollIntoView({
|
||||
block: 'center',
|
||||
inline: 'center',
|
||||
behavior: 'instant'
|
||||
});
|
||||
}
|
||||
@@ -81,6 +83,8 @@ func ScrollIntoViewBySelector(selector string) string {
|
||||
|
||||
if (!isInViewport(el)) {
|
||||
el.scrollIntoView({
|
||||
block: 'center',
|
||||
inline: 'center',
|
||||
behavior: 'instant'
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user