Skip to content

[Feature Request]: Allow toast location to be moved #3581

Open
@webfiltered

Description

@webfiltered

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Make the location that toast notifications appear configurable.

Proposed workflow

  1. Go to settings
  2. Click Toast Location dropdown (default: Right)
  3. Select Centre
  4. Toasts are now anchored to the centre of the top edge of the canvas, rather than the top-right corner

Additional information

On a 32:9 screen, it is easy to miss small changes (e.g. toast notification) on one side of the display if you are looking at the opposite edge.

Below is the hard-coded override I cherry-pick locally.

diff --git a/src/components/toast/GlobalToast.vue b/src/components/toast/GlobalToast.vue
index 848ad15c..fc9925da 100644
--- a/src/components/toast/GlobalToast.vue
+++ b/src/components/toast/GlobalToast.vue
@@ -64,8 +64,9 @@ function updateToastPosition() {
 
   styleElement.textContent = `
     .p-toast.p-component.p-toast-top-right {
-      top: ${rect.top + 20}px !important;
-      right: ${window.innerWidth - (rect.left + rect.width) + 20}px !important;
+      top: 20px !important;
+      left: 50% !important;
+      transform: translateX(-50%);
     }
   `
 }

┆Issue is synchronized with this Notion page by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions