eclipsesource / eclipsesource/tabris-js
ScrollView: cannot scroll to the top with disabled animation
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Description
### Problem description
When calling `scrollToY(0, {animate: false})`, the content does not scroll to the top. Other `y` values than `0` work as expected. When animation is enabled, scrolling works as expected too. Works as expected in 3.x nightly.
### Expected behavior
`scrollToY(0, {animate: false})` should scroll to the top.
### Environment
- Tabris.js version: 2.9.0
- OS: iOS 14.0.1
### Code snippet
```js
const {ui, ScrollView, TextView, Button} = require('tabris');
ui.contentView.append(
new ScrollView({left: 0, top: 0, right: 0, bottom: 0}).append(
new TextView({markupEnabled: true, left: 0, top: 'prev() 50', right: 0, text: [...Array(1000).keys()].map(i => `${i}
`).join()}),
),
new Button({centerX: 0, centerY: 0, text: 'scroll to 0 {animate: false}'}).on('tap', () => {
ui.contentView.find(ScrollView).first().scrollToY(0, {animate: false})
}),
new Button({centerX: 0, centerY: 50, text: 'scroll to 1 {animate: false}'}).on('tap', () => {
ui.contentView.find(ScrollView).first().scrollToY(1, {animate: false})
}),
new Button({centerX: 0, centerY: 100, text: 'scroll to 0 {animate: true}'}).on('tap', () => {
ui.contentView.find(ScrollView).first().scrollToY(0, {animate: true})
}),
);
```
Contributor guide
Assessment
This issue has not been assessed yet.