Skip to content

fix(dom): Hyperlinks are overridden when rendered after Paragraph#98

Open
Emivvvvv wants to merge 3 commits into
ratatui:mainfrom
Emivvvvv:fix/overridden-hyperlinks
Open

fix(dom): Hyperlinks are overridden when rendered after Paragraph#98
Emivvvvv wants to merge 3 commits into
ratatui:mainfrom
Emivvvvv:fix/overridden-hyperlinks

Conversation

@Emivvvvv

@Emivvvvv Emivvvvv commented May 6, 2025

Copy link
Copy Markdown

fixes: #97

This update refactors update_grid to detect when a line’s hyperlink structure changes (hyperlink is added or removed) and triggers a full re-render of that line. A new rerender_line method rebuilds the DOM with correct anchor elements for hyperlink groups. If no hyperlink changes are detected, only the modified cells are updated as before.

@orhun orhun changed the title fix(DOM): Hyperlinks are overridden when renereded after Paragraph fix(dom): Hyperlinks are overridden when rendered after Paragraph May 7, 2025

@orhun orhun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good, however I don't understand how this is currently fixing the issue.

It would be really nice if you can explain the problem and solution in detail. This might also lead to a cleaner solution :)

Comment thread Cargo.toml Outdated
Comment thread src/backend/dom.rs Outdated
@Emivvvvv Emivvvvv requested a review from orhun June 6, 2025 14:33
@orhun

orhun commented Jun 10, 2025

Copy link
Copy Markdown
Member

Thanks for the changes @Emivvvvv! Can you remind me how to test this again? Maybe we should update one of the existing examples to hit this case (so that it's clear that it works). What do you think?

Also did this work for you locally for your website?

@junkdog junkdog added the DOM DOM backend related label Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOM DOM backend related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Old Paragraph text overrides Hyperlink line

3 participants