Skip to content

fix: data field tab (backport #2288) - #2712

Open
mergify[bot] wants to merge 2 commits into
main-hotfixfrom
mergify/bp/main-hotfix/pr-2288
Open

fix: data field tab (backport #2288)#2712
mergify[bot] wants to merge 2 commits into
main-hotfixfrom
mergify/bp/main-hotfix/pr-2288

Conversation

@mergify

@mergify mergify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Describe the bug

When a user edits and saves a field under a non-default Data Fields tab, the form layout is re-
rendered and the selected tab is reset to the first tab, such as Deal Details. This makes the
user lose their current context after saving.

Root cause

FieldLayout kept the selected tab in local component state initialized to 0. When the Data
Fields layout was remounted or reloaded after save, that local state was recreated and the first
tab became selected again.

Changes

  • Lifted the Data Fields tab state to Activities.vue so it survives DataFields remounts.
  • Added v-model:tabIndex and v-model:tabName support to FieldLayout.
  • Restored the selected tab by stable tab name, which also works when tab labels are
    duplicated.
  • Persisted the selected Data Fields tab in sessionStorage per doctype and docname, so the
    tab can be restored after page remounts.
  • Added unit tests for tab persistence across layout remounts, DataFields remounts, tab reloads,
    and session storage restore.

Expected behaviour after fix

After editing and saving a field under another Data Fields tab, the user stays on the same tab
instead of being redirected back to the first tab.

Test plan

  • Added unit coverage in frontend/tests/unit/fieldLayoutTabState.test.js.
  • Run:
cd frontend
yarn test:run

closes #2270


This is an automatic backport of pull request #2288 done by Mergify.

@mergify

mergify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

1 participant