Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabbedForm: I cannot get the tabindex somehow when I click on the tabs #10532

Open
afilp opened this issue Feb 19, 2025 · 0 comments · May be fixed by #10549
Open

TabbedForm: I cannot get the tabindex somehow when I click on the tabs #10532

afilp opened this issue Feb 19, 2025 · 0 comments · May be fixed by #10549

Comments

@afilp
Copy link
Contributor

afilp commented Feb 19, 2025

What you were expecting:
TabbedForm onChange logic does not seem to work, so that I can get the current tabIndex (unless there is another way to achieve this)

What happened instead:
The onChange function is not triggered

Steps to reproduce:
This is how I have the logic setup:

    <TabbedForm
      sanitizeEmptyValues
      defaultValues={getDefaultValues({})}
      tabs={
        <TabbedFormTabs
          onChange={(tabIndex) => {
            console.log('log1-tabIndex2', tabIndex);
            setActiveTab(tabIndex);
          }}
        />
      }
    >
// ... more code here, with tabs, etc.

I believe the onChange will never be triggered, because you override this with a specific handleChange function which does not have a onChange() call at the end:

Image

Environment

  • React-admin version: "^5.2.1"
  • Last version that did not exhibit the issue (if applicable):
  • React version: "^18.3.1"
  • Browser: N/A
  • Stack trace (in case of a JS error):
@erwanMarmelab erwanMarmelab linked a pull request Feb 25, 2025 that will close this issue
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 a pull request may close this issue.

1 participant