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

Width is not working as expected on notifications positioned at center #108

Closed
BeroBurny opened this issue Apr 9, 2021 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@BeroBurny
Copy link

property width provided in addNotificitaion is not working on property container properties top-center, center and bottom-center

image

Code used to generate notifications from screenshot
['top-left', 'top-right', 'top-center', 'center', 'bottom-left', 'bottom-right', 'bottom-center'].forEach(container => {
      store.addNotification({
        title: "Wonderful!",
        message: "teodosii@react-notifications-component",
        type: "danger",
        insert: "top",
        container: container as ReactNotificationOptions['container'],
        dismiss: {
          duration: 10900,
        },
        width: 700,
      });
    })
@teodosii teodosii added the bug Something isn't working label Jun 2, 2021
@itsmichaeldiego
Copy link

itsmichaeldiego commented Sep 26, 2021

@teodosii I am experiencing the same issue. I did some investigation and it seems you've set a max-width: 350px in all the centered positions indeed:

.notification-container--bottom-center, .notification-container--center, .notification-container--top-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    left: calc(50% - 175px);
    max-width: 350px;
}

This could be fixed like so:

    left: 50%;
    transform: translate(-50%, 0);
    min-width: 350px;

@teodosii
Copy link
Owner

Fixed in 3.1.0, it was using width: 100% for centered containers instead of the supplied width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants