Skip to content

Editing instance settings while it's being created #1613

Closed

Description

@mkeeter

It's possible to edit instance settings while it's in the process of being created.

If you do that, then when the instance is created, you get a "your changes won't be saved" popup, which is very confusing.

Screen.Recording.2023-06-29.at.10.57.43.AM.mov

Activity

  1. david-crespo commented on Jun 29, 2023

    @david-crespo
    Collaborator

    Ugly. Instance create is synchronous, so we're waiting for the request to come back. So I think for now we have to just disable the form fields. Once we have async operations per RFD 402, we will get the initial response back much more quickly and can land on instances list or instance detail while it's creating.

  2. added this to the MVP milestone on Jul 5, 2023
  3. modified the milestones: MVP, 6 on Jan 1, 2024
  4. benjaminleonard commented on Jan 17, 2024

    @benjaminleonard
    Contributor

    A few options for fixing this:

    1. Only block navigating away if the form is not submitting. This seems to work on the mock API:
      const blocker = useBlocker(isDirty && isSubmitting). Easy fix, users can still edit the field...maybe fine?

    2. Disable key and pointer events on the form whilst it's submitting. Perhaps weird for the user not to be able to select their inputs whilst submitting?

    3. Extend the controller component (https://react-hook-form.com/advanced-usage#TransformandParse) subscribe to formState.isSubmitting and disable the inputs when a form is submitting. Perhaps the most robust and would fix this issue elsewhere, requires updates to every field component.

  5. charliepark commented on Jan 17, 2024

    @charliepark
    Contributor

    I'm going to start in on this, approaching it as Ben laid out in option #3 above. There are a few UI elements that aren't, strictly speaking, form elements, (tabs, buttons), but they impact the form state, so I'll freeze those as well when isSubmitting.

  6. self-assigned this
    on Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions