Open corsaronero opened 2 years ago
Hi @corsaronero
The code doesn't watch the changes of host DOM width and doesn't rerender the carousel after any such change. In your case this width changes if to open/close the sidebar. Browser resizing, changes of options, and changes of slides data can make the carousel rerender.
So you can change options via destructuring like here or fire the event resize
Hi @vitalii-andriiovskyi , thank you for all the awesome work on this. Question: in Angular, how can how can I fire the event resize
so that it triggers the carousel to rerender when I actually resize the window? I have a listener for window onresize, however I don't think the carousel is recognizing it. Please help - thank you!
Hi @emregan
The carousel listens to window resizing. So if you resize window, it rerenders. Take into account, if you use responsive
option, width you supply to it, is the width of the container holding the carousel, not the width of the window.
window.dispatchEvent(new Event('resize'));
works in Angular too. But be carefull using window
directly. If you have server-side rendering such usage will lead to the error.
Hi @vitalii-andriiovskyi please can you show a code sample of firing this resize event
Hi i add two image for better explain the problem the first image show the when the page init with the lateral panel open
the second image show when i close the panel and the carousel is not resized so you can see in the last image the space to the arrow
does anyone know how to fix this? Thanks.