vaadin / react-components

15 stars 4 forks source link

fix: handle colliding grid pro edit column renderers #211

Closed tomivirkki closed 10 months ago

tomivirkki commented 10 months ago

Description

There are two concepts in grid-pro edit column that cause problems with the React wrapper:

  1. It can use up to two separate functions (renderer / editModeRenderer) to render into the same root element.
  2. It manually clears the root element before switching between edit and view modes.

This PR tackles the issues by making the React-based renderers clear their managed content before grid-pro clears the cell content manually so that it becomes a non-action with React-based renderers and thus doesn't cause conflicts between the actual DOM vs virtual DOM state.

Fixes https://github.com/vaadin/react-components/issues/75

Type of change

Bugfix

codecov-commenter commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (db915cb) 95.49% compared to head (6baaa60) 95.58%. Report is 4 commits behind head on main.

:exclamation: Current head 6baaa60 differs from pull request most recent head 61c852f. Consider uploading reports for the commit 61c852f to get more accurate results

Files Patch % Lines
src/TabSheet.tsx 95.83% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #211 +/- ## ========================================== + Coverage 95.49% 95.58% +0.09% ========================================== Files 28 30 +2 Lines 222 272 +50 Branches 23 32 +9 ========================================== + Hits 212 260 +48 Misses 2 2 - Partials 8 10 +2 ``` | [Flag](https://app.codecov.io/gh/vaadin/react-components/pull/211/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vaadin) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/vaadin/react-components/pull/211/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vaadin) | `95.58% <97.72%> (+0.09%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vaadin#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.