ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.09k stars 13.51k forks source link

bug: Slidebox Gets Messed Up After Opening a Popover #3245

Closed shaulhadar closed 9 years ago

shaulhadar commented 9 years ago

Type: bug

Platform: android 4.4 webview

Hello Ionic Team. I have found a bug. if you have a slidebox, and than go to a page that has a popover, and you open the popover, and than go back to the page with the slidebox, you will see that the slidebox gets messed up. strangely, if i change the orientation of the phone to landscape and than back to portrait it fixed it, but this is definitely a bug.

Please fix this for next update, and in any case you can't see it let me know and i will upload you a folder with the problem. Thanks for your time, Shaul.

nicowenterodt commented 9 years ago

You could update the slidebox when entering the view again like this:

$scope.$on('$ionicView.beforeEnter', function() {
    $ionicSlideBoxDelegate.$getByHandle('you-swipe-handle').update();
});

Don't forget to add the delegate handle

<ion-slide-box delegate-handle="'you-swipe-handle">
shaulhadar commented 9 years ago

Hi and thanks. I will check it out ;)

tolu360 commented 9 years ago

This issue had persisted since beta 14 or so, for some reason opening a popover in a different view resets the width of the div.slider-slides to 0 such that on returning to the view with the slidebox, it is distorted.

I resorted to doing something similar to what @Elvistelefon suggested above:

$scope.$on('$ionicView.beforeEnter', function() {
    ionic.trigger('resize', {target:window});
  })

But I think it maybe something for the Ionic Team to look at.

weases commented 9 years ago

I am facing the exact same problem using rc-1. Just wanted to emphasize that this is not related to any specific platform. It can be reproduced on desktop chrome as well. Resizing the window fixes it, though.

shaulhadar commented 9 years ago

Yeah, I did some more tests and it is quite a nasty bug. It actually consists of two parts, the first part is that the width or height gets messed up, and the second problem is that the slider doesn't start from the begining when opening the page, after you saw the slider....

I checked a number of frameworks that have sliders, and this doesn't happen in none of them... so I assume that this is a bug that the ionic team is aware of and that they are going to push a fix in one of the next rc version :) at least, I really hope so ...

Fayozjon commented 9 years ago

Shaul

http://new.osat.pl/sekund-capital

22.03.2015, 10:52, "Shaul Hadar" notifications@github.com:Yeah, I did some more tests and it is quite a nasty bug. It actually consists of two parts, the first part is that the width or height gets messed up, and the second problem is that the slider doesn't start from the begining when opening the page, after you saw the slider....

I checked a number of frameworks that have sliders, and this doesn't happen in none of them... so I assume that this is a bug that the ionic team is aware of and that they are going to push a fix in one of the next rc version :) at least, I really hope so ...

—Reply to this email directly or .

Fayozjon commented 9 years ago

weases

http://enescofrance.com/videokurs_schet

22.03.2015, 10:18, "weases" notifications@github.com:I am facing the exact same problem using rc-1. Just wanted to emphasize that this is not related to any specific platform. It can be reproduced on desktop chrome as well. Resizing the window fixes it, though.

—Reply to this email directly or .

Fayozjon commented 9 years ago

Tolu

http://matrimoniodepelicula.com/dragon_opcion

17.03.2015, 01:42, "Tolu Olowu" notifications@github.com:This issue had persisted since beta 14 or so, for some reason opening a popover in a different view resets the width of the div.slider-slides to 0 such that returning to the view with the slidebox is distorted.

I resorted to doing something similar to what suggested above:

$scope.$on('$ionicView.beforeEnter', function() { ionic.trigger('resize', {target:window}); })

But I think it maybe something for the Ionic Team to look at.

—Reply to this email directly or .

RangerRick commented 9 years ago

Yup, I'm seeing the same issue: http://i.imgur.com/6kMzCy2.png

I have 2 canvases inside 2 slide boxes, when I navigate to a popup and back to my main dashboard view, the canvases are on top of each other.

I can confirm that @tolu360's workaround works for me:

$scope.$on('$ionicView.beforeEnter', function() {
    ionic.trigger('resize', {target:window});
  })
edparsons commented 9 years ago

Hey, guys so I had this issue and it seems to be opening the popup triggers the resize on sliderbox even if it's in a cached view. I've written a pull request for the ionic team to fix the issue and I'm waiting for it to be accepted. If there's any way to up vote the pull request that would be cool.

mhartington commented 9 years ago

I believe this was fixed in RC3. Can you please confirm this?

weases commented 9 years ago

Hey Mike, I am afraid I am still facing this issue. Please, see this Codepen.

edparsons commented 9 years ago

This is fixed in master, I don't know which version it was pushed into though. The fix is on line 46 of this file https://github.com/driftyco/ionic/blob/master/js/views/sliderView.js

But those lines definitely aren't there on codepen.

mhartington commented 9 years ago

@weases I may have been mistaken about the version number, it is fixed in the nightly builds.

http://codepen.io/mhartington/pen/RPbRPX

tolu360 commented 9 years ago

I'm glad to know that. Thank you Ionic team!

weases commented 9 years ago

aaah, I see. Thanks for the clarification, Mike.