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:
parent
27a74cd398
commit
2ba68ebf00
@ -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)
|
||||||
|
@ -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'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user