[joy-ui][Snackbar] Positioning is relative to Modal Dialog

Open
#39,959 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Nov 22, 2023.

Assessment

This issue has not been assessed yet.

Description

on hold package: joy-ui scope: toast
Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Steps to reproduce 🕹

Link to live example:
https://codesandbox.io/s/loving-galileo-33yp8g

Steps:

  1. Click one of the buttons in the Modal to show the Snackbar
Current behavior 😯

The Snackbar is positioned relative to the ModalDialog, not the window.

Expected behavior 🤔

I would expect the Snackbar's position to be fixed relative to the viewport. I wonder if this constitutes rethinking how the ModalDialog is centered? Since fixed elements are relative to a parent with transform, perhaps the ModalDialog should be centered by making the Modal container have position flex and alignItems/justifyContent center?

Context 🔦

No response

Your environment 🌎
npx @mui/envinfo
System:
    OS: macOS 14.1
  Binaries:
    Node: 20.9.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 119.0.6045.159
    Edge: Not Found
    Safari: 17.1
  npmPackages:
    typescript: 5.2.2 => 5.2.2 
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mui/material-ui

All issues in mui/material-ui

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.