Giter Site home page Giter Site logo

Comments (6)

teodosii avatar teodosii commented on May 22, 2024

I doubt you checked that each notification gets width: 100% so it gets as wide as the container. The width option is to have more control over the notification.

from react-notifications-component.

chitgoks avatar chitgoks commented on May 22, 2024

i assumed that would be the case which is why i opened this since i started at not using the width property and it doesnt expand based on content text. ill retry and put up a sample

from react-notifications-component.

chitgoks avatar chitgoks commented on May 22, 2024

hi teodosii, so this is how i called it

function showNotification(message, type, duration) {
    store.addNotification({
        message: message,
        type: type ? type : 'success',
        insert: 'top',
        container: 'top-right',
        animationIn: ['animated', 'fadeIn'],
        animationOut: ['animated', 'fadeOut'],
        dismiss: {
          duration: duration ? duration : 3000
        }
    });
}

please see attached for result.
notif

from react-notifications-component.

teodosii avatar teodosii commented on May 22, 2024

Actually, my mistake here. It doesn't get set to width: 100%, it gets set to width: auto which is is basically 100% of the container. But containers do not have a predefined width, that's up to you or anyone else to have these set, and due to the fact they have no width, auto might behave different from case to case.

You either stick to setting the width manually per notification or set the width to each container.

from react-notifications-component.

teodosii avatar teodosii commented on May 22, 2024

If you have any other questions, feel free to ask. These are at the moment the only 2 solutions - for me at least are enough - if you happen to have a better solution and it would benefit this library, I will gladly implement it. In the meantime I will close this issue.

from react-notifications-component.

chitgoks avatar chitgoks commented on May 22, 2024

ok that makes sense. it's not really urgent for me but ill look into this last once im done with my other tasks. ill get ack if i can find a solution. im still learning react now ;)

from react-notifications-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.