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

Issues with CreateTearsheetStep's onBack Function and State Management #1175

Open
hanzlahabib opened this issue Sep 10, 2023 · 1 comment
Open
Labels
status: triage type: bug Something isn't working

Comments

@hanzlahabib
Copy link

hanzlahabib commented Sep 10, 2023

Description

When using the CreateTearsheet and CreateTearsheetStep components from the @carbon/ibm-products package, I'm experiencing issues with the onBack function not being triggered. Additionally, the current step state variable is not updated correctly when navigating back and forth between steps.

Expected behavior

  1. The onBack function should be triggered when the "Back" button is clicked.
  2. The currentStep state variable should accurately reflect the current step in the tearsheet.

Actual behavior

  1. The onBack function is not triggered when the "Back" button is clicked.
  2. The currentStep state variable does not accurately reflect the current step in the tearsheet.

Steps for reproducing

Steps for reproducing

  1. Navigate to Step 2 or beyond in the tearsheet.
  2. Click the "Back" button.
  3. Observe that the onBack function is not triggered.
  4. Observe that the currentStep state variable is not updated.

Feature Requests

More Control Over Submit Button
Description
Currently, there's limited control over the submit button and its behavior across different steps. It would be beneficial to have more flexible options for button customization.

Proposed Features

  1. Ability to Hide All Buttons: Provide an option to hide all buttons, showing only the "Cancel" button if needed.
  2. Dynamic Button Configuration: Allow a way to dynamically pass buttons to the component, enabling different combinations of buttons for different steps.
  3. Conditional Button Text: Provide an option to change the text of the submit button conditionally, based on the current step.

not always the last step is to submit step, one example scenario: I have uploaded file content in step 3 and want to show a summary in the last step. I don't see enough control to play around and hide buttons or pass custom buttons to override functionality

By incorporating these features, developers would have greater control over the UX flow of the tearsheet component, allowing for more tailored interactions based on the specific needs of each step.

While I've tried my best to understand the current behavior and constraints of the component, there's a chance I might have missed something in the documentation. If that's the case, I'd appreciate being directed to the relevant sections. My intent is to collaborate and improve the component for the benefit of everyone using it.

@hanzlahabib hanzlahabib added status: triage type: bug Something isn't working labels Sep 10, 2023
@hanzlahabib
Copy link
Author

I apologize for any confusion my previous ticket may have caused. After digging deeper into the codebase, I realized that createTearsheetStep actually exposes the property as onPrevious rather than onBack, which was an oversight on my part. My apologies for any inconvenience this may have caused.

That said, I would still very much appreciate it if you would consider my feature requests for enhanced flexibility and control over the Submit and Cancel buttons. They would be a great addition to the library and benefit the developer experience.

On another note, I've found it challenging to navigate the documentation for different features. Is it possible that some of the documentation is private to your organization? While I did find some Storybook components, it seems that the IBM security components are not thoroughly documented, or perhaps I'm not looking in the right places. Any guidance on this would be greatly appreciated.

Thank you for your time and understanding.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant