Skip to content

Conversation

@vursen
Copy link
Contributor

@vursen vursen commented Jun 3, 2021

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 is editModeRenderer that replaces the content rendered by renderer with an input when editing a column. Once you finish editing, it calls renderer to 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

  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@vursen vursen added the no-polymer Removing Polymer from Vaadin public APIs label Jun 3, 2021
@vursen vursen requested a review from tomivirkki June 3, 2021 14:14
@vursen vursen changed the title fix: re-create template instance after clearing content fix: re-create template instance after detaching instance's root Jun 3, 2021
@vursen vursen force-pushed the feat/template-renderer/re-init-disconnected-templates branch from 2351a91 to f8f5c03 Compare June 3, 2021 14:17
@vursen vursen force-pushed the feat/template-renderer/re-init-disconnected-templates branch from 75d5905 to 04a7c7f Compare June 3, 2021 14:52
@vursen vursen requested a review from tomivirkki June 3, 2021 14:52
@vursen vursen force-pushed the feat/template-renderer/re-init-disconnected-templates branch 2 times, most recently from eb058ef to b6f4981 Compare June 3, 2021 15:21
@vursen vursen force-pushed the feat/template-renderer/re-init-disconnected-templates branch from b6f4981 to fdc6ec8 Compare June 3, 2021 15:44
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 3, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen vursen merged commit 878a254 into master Jun 3, 2021
@vursen vursen deleted the feat/template-renderer/re-init-disconnected-templates branch June 3, 2021 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-polymer Removing Polymer from Vaadin public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants