eclipsesource / eclipsesource/tabris-js

ScrollView: cannot scroll to the top with disabled animation

Open
#2,116 1 comment 0 reactions 0 assignees View on GitHub
2.x bug ios
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.