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
Bug in the Toast Component Section on the Docs Website #5729
Comments
Have a look at the contributing docs The local setup section in the readme should get you started with running a local copy of the docs site. Thanks! |
Thanks! Working on it! |
Hi @kyletsang I suppose this issue is because of importing the image via I think a workaround for this will be to download the svg file for all placeholders, put it in asset and then import relatively from there. Though then it won't be ideal for an example with LIVE EDITOR. Detailed explanation of what happens: While this isn't the same with the other example where animation={false}. So, by this it is intuitive that the problem lies with Let me know your views upon this on how to fix this. |
Currently holderjs is initialized whenever the example codeblock is rendered, but not when there are any DOM changes in the example itself. The toast with animation is remounted when it is shown, but holderjs isn't run, so image doesn't appear properly. Interestingly, the toast is only unmounted when there is an animation. Here's the relevant code for holderjs initialization: react-bootstrap/www/src/components/ReactPlayground.js Lines 116 to 125 in 00dffcd
We could probably use a mutation observer here to watch for DOM changes? |
Thanks for taking time to help me resolve my doubt. This makes sense to me :) |
Yeah that’s the one. I haven’t used it myself yet, so can’t really give pointers, sorry. |
Hey guys, I verified that the Mutation Observer does fix this issue. Can I send a PR for this? |
…r all re-rendered imgs, for animated toast (fix react-bootstrap#5729)
Feel free to send a PR. |
Just sent PR #5814, in regards to this issue. |
Describe the bug
At https://react-bootstrap.github.io/components/toasts/ there is a dismissible toast section. That demonstrates two types of toast dismissals, with Animation and without Animation. In that, when toggled for with animation the toast disappears. But when again toggled, due to some reason the Toast Header Image disappears.
The Video demonstrating this:
To Reproduce
Steps to reproduce the behavior:
Toggle Toast with Animation
(also observe that the Placeholder Image in the Header is visible)Toggle Toast with Animation
buttonExpected behavior
The image must not disappear.
Observation
Initially the Image imports the SVG well. src= SVG and data-src = "holder.js/20x20?text=%20"
But when toggled, the data-src = none and src= "holder.js/20x20?text=%20"
While it should be same as before as essentially we are just altering
show
state.Environment (please complete the following information)
Additional context
I am very new as a contributor to React Bootstrap. Was developing my own React component library, so while searching for inspiration from Bootstrap, found this small bug.
Quite intrigued to learn and in contributing to Bootstrap Open Source! Would love to work on this issue, please assist me upon how to get started and will try to resolve this issue ASAP!
The text was updated successfully, but these errors were encountered: