fix: re-create template instance after detaching instance's root #2083
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.
Description
Currently, the template renderer doesn't re-render the template instance after the instance's root has been detached from DOM (by the user, for example).
This issue came up while removing Polymer Template API from
vaadin-grid-pro. There iseditModeRendererthat replaces the content rendered byrendererwith an input when editing a column. Once you finish editing, it callsrendererto return the original content to the column, but at that time the template instance' root turns disconnected with DOM and nothing is rendered.This PR aims to address this issue. From now on, the template renderer creates a new template instance if for some reasons the instance's root is detached from DOM.
Related to #410.
Type of change
Checklist