Skip to content

[FIX] Figure: only focus when the selected figure changes#8844

Open
rrahir wants to merge 1 commit into
masterfrom
master-fix-focus-loss-rar
Open

[FIX] Figure: only focus when the selected figure changes#8844
rrahir wants to merge 1 commit into
masterfrom
master-fix-focus-loss-rar

Conversation

@rrahir
Copy link
Copy Markdown
Collaborator

@rrahir rrahir commented Jun 3, 2026

The condition of the useEffect to re-focus a figure were removed by mistake. This meant that every render, if there was a selected figure, its DOM element would be automatically focus.

There was a race condition with the component SelectionInput that sometimes let the latter have the focus, sometimes not, which lead to the weird behaviour described in the task:

  • Insert a scorecard
  • Add a key value
  • Edit the key value and select it
  • Hit backspace twice

=> The first press deletes the value, the second deletes the chart

Task: 6267606

Description:

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

Task: TASK_ID

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

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented Jun 3, 2026

Pull request status dashboard

The condition of the useEffect to re-focus a figure were removed by
mistake. This meant that every render, if there was a selected figure,
its DOM element would be automatically focus.

There was a race condition with the component SelectionInput that
sometimes let the latter have the focus, sometimes not, which lead to
the weird behaviour described in the task:

- Insert a scorecard
- Add a key value
- Edit the key value and select it
- Hit backspace twice

=> The first press deletes the value, the second deletes the chart

Task: 6267606
@rrahir rrahir force-pushed the master-fix-focus-loss-rar branch from f98bc5d to 213e6a8 Compare June 3, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants