odoo/o-spreadsheet#7488

Created by BI, Adrien Minne (adrm)

Blocked

label
odoo:19.0-fix-selection-input-unmount-adrm
head
c0392867018f0020d13ffc14800c3b8fcadfe88a
odoo/o-spreadsheet
19.0 #7488 missing r+
master

[FIX] side panel: close selection input when switching tab

When focusing the selection input in the chart side panel, changing tab would not close the selection input, even though the input isn't visible anymore.

It's because since 91c0583, changing the tab would keep the component mounted, only hiding it with d-none (to keep its state). Relying on the selection input onWillUnmount to reset the state is not enough.

We now rely on a useEffect that checks the input.offsetParent property, which is null when an ancestor has display: none.

task-5249165

Task: 5249165

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