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

Set comment position correctly relative to scroll position #8511

Merged
merged 1 commit into from May 12, 2022

Conversation

gasman
Copy link
Collaborator

@gasman gasman commented May 10, 2022

Fixes #8500. As a consequence of the CSS changes in c6fdb6b, scroll position is no longer reflected in the document element's scrollTop property, but on the <main> element instead. As a result, comment positions were not being adjusted for scroll position. To account for this (and any future CSS changes), we walk all ancestor elements to calculate the true scroll position.

Tested on Chrome 101.0.4951.54 and Firefox 97.0.1 on OS X.

Please check the following:

  • Do the tests still pass?1
  • Does the code comply with the style guide?
    • Run make lint from the Wagtail root.
  • For Python changes: Have you added tests to cover the new/fixed behaviour?
  • For front-end changes: Did you test on all of Wagtail’s supported environments?2
    • Please list the exact browser and operating system versions you tested:
    • Please list which assistive technologies 3 you tested:
  • For new features: Has the documentation been updated accordingly?

Please describe additional details for testing this change.

Footnotes

  1. Development Testing

  2. Browser and device support

  3. Accessibility Target

Fixes wagtail#8500. As a consequence of the CSS changes in c6fdb6b, scroll position is no longer reflected in the document element's scrollTop property, but on the `<main>` element instead. As a result, comment positions were not being adjusted for scroll position. To account for this (and any future CSS changes), we walk all ancestor elements to calculate the true scroll position.
@squash-labs
Copy link

squash-labs bot commented May 10, 2022

Manage this branch in Squash

Test this branch here: https://gasmanfixcomment-scroll-positi-uo6kd.squash.io

Copy link
Contributor

@kaedroho kaedroho left a comment

Choose a reason for hiding this comment

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

Nice catch! Looks good to me

@gasman gasman merged commit 7d8d900 into wagtail:main May 12, 2022
gasman added a commit that referenced this pull request May 12, 2022
Fixes #8500. As a consequence of the CSS changes in c6fdb6b, scroll position is no longer reflected in the document element's scrollTop property, but on the `<main>` element instead. As a result, comment positions were not being adjusted for scroll position. To account for this (and any future CSS changes), we walk all ancestor elements to calculate the true scroll position.
stevedya pushed a commit to stevedya/wagtail that referenced this pull request May 18, 2022
)

Fixes wagtail#8500. As a consequence of the CSS changes in c6fdb6b, scroll position is no longer reflected in the document element's scrollTop property, but on the `<main>` element instead. As a result, comment positions were not being adjusted for scroll position. To account for this (and any future CSS changes), we walk all ancestor elements to calculate the true scroll position.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment-Overlays outside the view in the new Page Editor
2 participants