Comments (6)
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.
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.
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.
from react-notifications-component.
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.
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.
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)
- How to give width to notification in percentage HOT 2
- Project breaking due to "Removed default export" HOT 1
- TypeError: Cannot read properties of undefined (reading 'addNotification') HOT 2
- Does not display any notifications
- Scrolling when screen is full of notifications HOT 2
- Please fix typo HOT 1
- Notifications are not auto dismissed when browser tab is inactive HOT 3
- Unable to resolve dependency tree error when installing npm packages HOT 4
- Fade In animation suddenly appears instead of playing the animation HOT 3
- uncompatibility with animate.css library HOT 6
- Notifications created in rapid succession may not be removed from the DOM when dismissed HOT 4
- Not all styles are renamed HOT 1
- npm ERR! Missing script: "build:library:dev" HOT 3
- compatibility issue
- The component's test for closing by timeout failed HOT 1
- Store.addNotification is getting called and failing in my tests HOT 4
- 'message' property renders only string, not component HOT 1
- Notification blinks when it appears HOT 2
- Add `top: 0` to rnc__base
- Desktop Notifications as an option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-notifications-component.