Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(QScrollArea): correctly compute snap position for thumb #17206 #17207

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

thexeos
Copy link
Contributor

@thexeos thexeos commented May 18, 2024

Resolves #17206

What kind of change does this PR introduce?

  • Bugfix

Does this PR introduce a breaking change?

  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on an Electron app
  • Any necessary documentation has been added or updated in the docs or explained in the PR's description.

Copy link

github-actions bot commented May 18, 2024

UI Tests Results

    1 files     97 suites   37s ⏱️
1 019 tests 1 019 ✅ 0 💤 0 ❌
1 038 runs  1 038 ✅ 0 💤 0 ❌

Results for commit f764d29.

♻️ This comment has been updated with latest results.

const pos = offset - data.thumbSize.value / 2
setScroll(pos / container[ axis ].value * data.size.value, axis)
const targetThumbStart = offset - data.thumbSize.value / 2
const percentage = between(targetThumbStart / (props.container[ axis ].value - data.thumbSize.value), 0, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

There is no container prop. Did you mean container instead of props.container?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. You are correct! I have taken this from another branch that has props.container. New commit pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QScrollArea: thumb doesn't center on mouse point for small thumbs (long content)
2 participants