Skip to content

Font Library: Make the delete confirm dialog close immediatly after clicking 'Delete' #58386

@afercia

Description

@afercia

Description

When deleting an installed fonr and clicking 'Delete' in the confirm dialog, the confirm dialog stays open untile the font is actually deleted and the fonr library is refreshed.

This seems to be less than ideal for a few reasons>

  • As the dialog stays open, users can click 'Delete' ultiple times, especially on a slow internet.
  • By clicking multiple times, a new delete request is triggered, which leads to errors like the one in the screenshot below:

Screenshot 2024-01-29 at 14 03 07

  • Whatever teherror is, for example no internet connection, the confirm dialog stays open and the error notice appears behind the confirm dialog overlay. The actual error message is partially hidden. Depending on the size of the screen in use, the error may even be completely hidden. I'm not sure hiding error messages is a good user experience. Screenshot:

Screenshot 2024-01-29 at 15 10 53

Step-by-step reproduction instructions

  • Go to Site editor > Styles > Typography > Manage fonts.
  • Install a Google font.
  • Go to the Library tab and click the font you installed.
  • Click 'Delete' at the bottom of the modal dialog. A confirm dialog opens.
  • Quickly click 'Delete' multiple times.
  • Observe an error message appears within the Fonts modal dialog, behind the confirm dialog overlay.
  • Observe that after the font is actually deleted, the confirm dialog and the notice with the error messsage disappear.
  • Note: for accessibility, when the confirm dialog closes, focus should be better handled. This is tracked in another issue.
  • Install a new Google font.
  • Go to the Library tab and click the font you installed.
  • In your browser dev tools > Network, set your browseer to 'offline'.
  • Click Delete and then Delete again in the confirm dialog.
  • Observe the confirm dialog stays open.
  • Observe an error message appears within the Fonts modal dialog, behind the confirm dialog overlay.
  • Click Delete again. Observe the confirm dialog stays always open.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DesignNeeds design efforts.[Feature] Font Library[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Type] BugAn existing feature does not function as intended[Type] FeedbackIssues that relate purely to feedback on a feature that isn't necessarily actionable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions