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

bug: Side Menu expose-aside-when directive doesn't work #3244

Closed
TheCodeDestroyer opened this issue Mar 6, 2015 · 11 comments
Closed

bug: Side Menu expose-aside-when directive doesn't work #3244

TheCodeDestroyer opened this issue Mar 6, 2015 · 11 comments
Milestone

Comments

@TheCodeDestroyer
Copy link

Type: bug

Platform: all

Version: v1.0.0-rc.0-nightly-1120

Now there is an issue when my menu is closed and I press the button it opens the side menu and immediately closes it.
The menu works if I don't include this directive...

You can see this issue in CodePen

The issue is in this function: self.exposeAside() as this if clause doesn't return:

if (!(self.left && self.left.isEnabled) && !(self.right && self.right.isEnabled)) return;

I thank you in advance.

@TheCodeDestroyer
Copy link
Author

Did a bit more digging and it's not self.exposeAside() issue. I checked v1.0.0-beta.14-nightly-1000
and the difference between RC nightly is that checkAsideExpose() is being called all the time, which then closes the side menu since the if clause fails to be true.

@tolu360
Copy link

tolu360 commented Mar 6, 2015

This bug is also in v1.0.0-rc.0, and in nightlies after the version 1.0.0-beta.14-nightly-1042.

@shprink
Copy link

shprink commented Mar 7, 2015

same over here

@manosim
Copy link

manosim commented Mar 8, 2015

+1. Just updated from beta 14 to rc.0 and now the side menu is broken because of expose-aside-when="large". If I remove it, then the side menu is working properly.

@vgrafe
Copy link

vgrafe commented Mar 8, 2015

+1, would love to see this feature working as planned.

@sbilharz
Copy link

+1!

@mixersoft
Copy link

I saw this as well in rc0. I just added the following line for now

 self.exposeAside = function(shouldExposeAside) {
    if (!(self.left && self.left.isEnabled) && !(self.right && self.right.isEnabled)) return;
    # do not close when the side-menu was opened by toggle()
    if (angular.element($ionicBody.get()).hasClass('menu-open')) return

@Riron
Copy link

Riron commented Mar 10, 2015

+1. This line seems to be the problem, as said in this issue

@krlwlfrt
Copy link

+1

@dudeko
Copy link

dudeko commented May 13, 2015

@mixersoft's line fixes the problem I'm having.

My problem:
I've got expose-aside-when="large" and, on a small screen, if I have focus on an input with the virtual keyboard opened, and then I tap to toggle the left menu, the left menu autocloses just after blur happens on the input and the virtual keyboard closes.

What I gathered is that every time the keyboard appears/disappears, the size of the view changes, and an evaluation is made whether the side menu should be opened or closed because of the expose-aside-when directive.

You can replicate this problem by:
-creating a new sidemenu project,
-putting an input on playlists.html,
-putting expose-aside-when="large" on the ion-side-menu inside menu.html,
-running the app, activating the keyboard by tapping the input and then toggling the side menu. It should open and close automatically.

I can't seem to find any other good way of dealing with this. I've tried doing a timeout to delay the menu toggle, and it kinda works, but the time it takes for the keyboard to close varies and depends on how much content I have on my view. Also, this isn't the ideal solution, as it would feel sluggish for the user to tap and have to wait 2 seconds or so for the side menu to open.

@mlynch
Copy link
Contributor

mlynch commented Dec 7, 2015

Duplicate of #2328 which is now fixed and will be in 1.2

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 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