jesperct opened a new pull request, #40173:
URL: https://github.com/apache/superset/pull/40173

   ### SUMMARY
   
   Zooming into an ECharts chart with the data zoom slider and then hovering it 
could snap the zoom back to default.
   
   The trigger is a container width change. A rich tooltip that lists many 
series makes the page taller, a vertical scrollbar appears, the chart container 
narrows, and upstream `transformProps` re-runs and returns a new 
`echartOptions` reference. The `setOption` effect in `Echart.tsx` then runs 
again with `notMerge: true`, which replaces the whole option payload and drops 
whatever dataZoom range the user had set.
   
   This captures `getOption().dataZoom` right before `setOption` when 
`notMerge` is true, and restores the range with `dispatchAction` afterwards. A 
fresh chart with no engaged range restores nothing, so default behavior is 
unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A, interaction-state fix with no visual change. Verified in the browser 
and with unit tests.
   
   ### TESTING INSTRUCTIONS
   
   1. Create a line chart on a dataset with a dimension that produces many 
series. Enable zoom and rich tooltip.
   2. Add it to a dashboard sized so the chart fits without a scrollbar.
   3. Drag the data zoom slider to zoom in.
   4. Hover the chart so the rich tooltip renders and extends the page (a 
scrollbar appears).
   5. The zoom stays where you set it. Before this fix it reset to default.
   
   Unit tests: 
`superset-frontend/plugins/plugin-chart-echarts/test/components/Echart.test.tsx`
 (2/2 pass).
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to