Skip to content

fix(links): scroll to anchor links directly#8857

Merged
mejo- merged 1 commit into
mainfrom
fix/scroll_to_anchor_links
Jul 13, 2026
Merged

fix(links): scroll to anchor links directly#8857
mejo- merged 1 commit into
mainfrom
fix/scroll_to_anchor_links

Conversation

@mejo-

@mejo- mejo- commented Jul 12, 2026

Copy link
Copy Markdown
Member

Setting location.href doesn't work reliably as the window may hold several editors with conflicting IDs (e.g. reader and editor in Collectives). Instead, scroll to the heading in view.dom.

Fixes: #8804

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits

🤖 AI (if applicable)

  • The content of this PR was partly generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Setting location.href doesn't work reliably as the window may hold
several editors with conflicting IDs (e.g. reader and editor in
Collectives). Instead, scroll to the heading in `view.dom`.

Fixes: #8804

Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- self-assigned this Jul 12, 2026
@mejo- mejo- requested a review from max-nextcloud as a code owner July 12, 2026 16:32
@mejo- mejo- added the bug Something isn't working label Jul 12, 2026
@mejo- mejo- requested a review from silverkszlo as a code owner July 12, 2026 16:32
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Jul 12, 2026
@mejo- mejo- moved this from 🧭 Planning evaluation (don't pick) to 👀 In review in 📝 Productivity team Jul 12, 2026
@mejo-

mejo- commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

nextcloud/collectives#2633 brings a regression test for this fix.

@mejo-

mejo- commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

/backport to stable32

@mejo-

mejo- commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

/backport to stable33

@mejo-

mejo- commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

/backport to stable34

@mejo- mejo- merged commit 1af588c into main Jul 13, 2026
61 checks passed
@mejo- mejo- deleted the fix/scroll_to_anchor_links branch July 13, 2026 09:14
@github-project-automation github-project-automation Bot moved this from 👀 In review to ☑️ Done in 📝 Productivity team Jul 13, 2026
@backportbot

backportbot Bot commented Jul 13, 2026

Copy link
Copy Markdown

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/8857/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick f36ea641

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/8857/stable32

Error: Failed to check for changes with origin/stable32: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@mejo-

mejo- commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

Manual backport to stable32: #8868

mejo- added a commit to nextcloud/collectives that referenced this pull request Jul 13, 2026
- Migrate test to open page URL with heading anchor from Cypress
- Add test to click on anchor link to current page (regression test for
  nextcloud/text#8857)

Signed-off-by: Jonas <jonas@freesources.org>
mejo- added a commit to nextcloud/collectives that referenced this pull request Jul 13, 2026
- Migrate test to open page URL with heading anchor from Cypress
- Add test to click on anchor link to current page (regression test for
  nextcloud/text#8857)

Signed-off-by: Jonas <jonas@freesources.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

Anchor links to same page in Collectives broken in edit mode

2 participants