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

Make the Submit button for the static_html_task blueprint customizable #692

Closed
pringshia opened this issue Mar 3, 2022 · 1 comment · Fixed by #879
Closed

Make the Submit button for the static_html_task blueprint customizable #692

pringshia opened this issue Mar 3, 2022 · 1 comment · Fixed by #879
Assignees
Labels

Comments

@pringshia
Copy link
Contributor

pringshia commented Mar 3, 2022

The Submit button for the static html task is rendered from within the blueprint. This makes it difficult for users to control, e.g. in cases where they may want to disable the button.

Although we do recommend folks to use React, I think to help transition users with existing projects into using Mephisto, we should support use cases such as this.

<Button type="submit" disabled={submitting}>

Recommendations:

  • Adding an in-line comment to the demo onboarding file in the examples folder explaining why the Submit button isn't shown there and how to "access" it for customization. This is a source of confusion initially for users.
    • One workaround at the moment is to do something like document.querySelector("button[type=submit]").disabled = true;. At the least, we should add an HTML ID to the submit button to make it easier to target
  • Allow the default submit button to be "hidden" so users can provide their own implementation. Perhaps configurable via setting a global variable, a la window.HIDE_MEPHISTO_SUBMIT_BUTTON = true. Or perhaps via Hydra config. @JackUrb any recommendations/preferences?

cc/ @edwardguo61

@pringshia pringshia self-assigned this Mar 3, 2022
@JackUrb
Copy link
Contributor

JackUrb commented Mar 3, 2022

I imagine that it makes sense to control the button via a global variable just because then the code for inserting a personal submit button would be colocated with this option set. It would be doable with hydra, but that feels like it'd be far away from the use of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants