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

Opening a modal triggers the Window resize event #2309

Closed
shprink opened this issue Sep 27, 2014 · 3 comments
Closed

Opening a modal triggers the Window resize event #2309

shprink opened this issue Sep 27, 2014 · 3 comments

Comments

@shprink
Copy link

shprink commented Sep 27, 2014

I have several actions bound on the window resize event (like updating SVGs size etc.). Opening a modal triggers them every time. I believe opening a modal should not trigger the resize event.

http://codepen.io/shprink/pen/CFxiG

Cheers,
Julien

@adzialocha
Copy link

I experience a possible bug now because of this. Its propably a new issue but connected to this one. It occurs since the beta-14 release with different ion-slide directives in multiple views. The resize event triggers the setup method of sliders even if theire put in the view cache (invisible) causing a recalculation of theire dimension.

The container element inside ionic.views.Slider listens to window.resize events which is okay until it is visible. Views, which are cached, in the background, containing a slider, will still listen to this event (the kill function handling the event removal is not called when putting it out of view). The problem here is that cached, non-visible views have the style display: none, the resize event triggers a new setup which then sets the width to zero since the element is not displayed.

Going back to this view at one point in the app results in a broken slider (invisible since its width is zero).

@copilots-app
Copy link

Why is this closed? Opening a modal shouldn't trigger a "resize"? In my case I have iScroll completely refreshing upon 'resize' .. which is really bad.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants