odoo/o-spreadsheet#4574

Created by fw-bot
Merged at 1080dd9d363cee7a3757aa2241ad736afb9d7858

Statuses:

label
odoo:saas-17.3-17.0-fix-paste-chart-rar-lYtg-fw
head
b04ea1019abe9ac64bc31bc9591ecc5d1018c9c4
merged
3 months ago by BI, Lucas Lefèvre (lul)
odoo/o-spreadsheet
17.0 #4404
saas-17.1 #4571
saas-17.2 #4573
saas-17.3 #4574
master #4575

[FW][FIX] grid: prevent paste default

Followup of #4298 The issue of the replacement of DOM elements still occured when we'd paste a chart is a specific way (see #How to reproduce). This commit ensures that the default paste behaviour is prevented when the lib has a custom handler, not just through the composer.

In this case, it is FigureContainer that is affected. After the paste effect, it replaces itself outside the visible part of its container GridOverlay. This issue would arise in Firefox and not Chromium-based browser. It to be linked to how the two handle the repositioning of static elements. This revision addresses this by setting the position of FigureContainer to absolute and not static.

How to reproduce:
On Firefox,
- select a chart and open its sidepanel
- cut it (Ctrl-x)
- Focus a selectionInput in the sidepanel
- click on the grid to update the selectionInput
- immediatly paste the chart (Ctrl-v) -> the page layout is broken. On the demo spreadsheet, the charts all disappeared and the "Add rows" button is visible even if the bottom of the grid is way below the viewport.

task-3949903

Description:

description of this task, what is implemented and why it is implemented that way.

Task: : 3949903

review checklist

  • [ ] feature is organized in plugin, or UI components
  • [ ] support of duplicate sheet (deep copy)
  • [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • [ ] in model/UI: ranges are strings (to show the user)
  • [ ] undo-able commands (uses this.history.update)
  • [ ] multiuser-able commands (has inverse commands and transformations where needed)
  • [ ] new/updated/removed commands are documented
  • [ ] exportable in excel
  • [ ] translations (_t("qmsdf %s", abc))
  • [ ] unit tested
  • [ ] clean commented code
  • [ ] track breaking changes
  • [ ] doc is rebuild (npm run doc)
  • [ ] status is correct in Odoo

Forward-Port-Of: #4404