-
Notifications
You must be signed in to change notification settings - Fork 71
fix: render markdown content on re-attachment #7808
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com>
Copilot finished work on behalf of
sissbruecker
August 6, 2025 16:50
|
sissbruecker
approved these changes
Aug 7, 2025
web-padawan
approved these changes
Aug 7, 2025
vaadin-bot
pushed a commit
that referenced
this pull request
Aug 7, 2025
* Initial plan * Fix re-attaching Markdown component content disappearing issue Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> * run formatter --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
vaadin-bot
pushed a commit
that referenced
this pull request
Aug 7, 2025
* Initial plan * Fix re-attaching Markdown component content disappearing issue Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> * run formatter --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
web-padawan
pushed a commit
that referenced
this pull request
Aug 7, 2025
* Initial plan * Fix re-attaching Markdown component content disappearing issue * run formatter --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
web-padawan
pushed a commit
that referenced
this pull request
Aug 7, 2025
* Initial plan * Fix re-attaching Markdown component content disappearing issue * run formatter --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
vursen
pushed a commit
that referenced
this pull request
Aug 7, 2025
* Initial plan * Fix re-attaching Markdown component content disappearing issue Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> * run formatter --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
vursen
pushed a commit
that referenced
this pull request
Aug 7, 2025
* Initial plan * Fix re-attaching Markdown component content disappearing issue Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> * run formatter --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sissbruecker <357820+sissbruecker@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a Markdown component is detached and then re-attached to the component tree, the content disappears from the UI, leaving only an empty tag in the DOM.
Root Cause
The issue occurs in the
scheduleContentUpdate()
method. When a component is re-attached:clientContent
field still contains the previous content valuescheduleContentUpdate()
comparesclientContent
withserverContent
Solution
Override
onAttach()
to resetclientContent
tonull
when the component is re-attached. This ensures thatscheduleContentUpdate()
will always send the content to the client on re-attachment.The fix is minimal and targeted:
Test Case
Added
testReAttachment_contentPreserved()
to verify that content is properly sent to the client when a component with existing content is re-attached.Fixes #7805.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
maven.vaadin.com
/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -Duser.language=en -Duser.country=US -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/flow-components/flow-components org.codehaus.plexus.classworlds.launcher.Launcher test -pl vaadin-markdown-flow-parent/vaadin-markdown-flow -am
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.