Skip to content

fix(rtl): menu - #11233

Closed
AmitMY wants to merge 12 commits into
ionic-team:masterfrom
AmitMY:menu
Closed

AmitMY wants to merge 12 commits into
ionic-team:masterfrom
AmitMY:menu

Conversation

@AmitMY

@AmitMY AmitMY commented Apr 15, 2017 •

Copy link
Copy Markdown
Contributor

Short description of what this resolves:

  • Having [side]="exp" on ion-menu now updates the slide gesture in real time
  • Menu when switching to RTL or to LTR in runtime
  • Menu sides now include: 'left' | 'right' | 'start' | 'end'

Changes proposed in this pull request:

Menu
  • For the slide-edge-gesture I added a method setEdges to update the edges whenever needed.
  • Menu now implements angular lifecycle interfaces.
  • Changed side input to get/set
Swipe-back
  • For platform, I added an event emitter dirChanged, that emits whenever you call .setDir
  • Then, from swipe-back, I initialised the slide using current dir, and added a subscriber for when dir changes.
Tests
  • should get the only left menu on start ltr
  • should get the only left menu on end rtl
  • should get the only right menu on end ltr
  • should get the only right menu on start rtl
  • should switch menu side in runtime
  • should switch menu side in runtime by direction

Ionic Version: 3.x

This PR makes #11190 obsolete.

All tests (including new ones) passed

@AmitMY AmitMY changed the title fix(rtl): update menu gesture side in real-time fix(rtl): update slide gesture side in real-time Apr 16, 2017
@AmitMY

AmitMY commented Apr 20, 2017

Copy link
Copy Markdown
Contributor Author

@brandyscarney Ready and passing. Can you review?

@AmitMY AmitMY changed the title fix(rtl): update slide gesture side in real-time fix(rtl): menu Apr 20, 2017
@AmitMY

AmitMY commented Apr 20, 2017 •

Copy link
Copy Markdown
Contributor Author

@John-Luke Can you have a look to see if I am missing something for the menu / tests?
@manucorporat Is this PR ok? (it takes the right stuff from old one and adds on them)

And anyone who can help - This was tested only via code tests. Is there a way to see this in a real app somewhere?

I hope this manages to get merged in time for next release, as this allows normal rtl apps usage, which means more rtl bugs will be found and fixed for version after that :)
It is important to say that these changes does not effect current (3.0.2) behavior, and is fully compatible.

@manucorporat

manucorporat commented Apr 23, 2017 •

Copy link
Copy Markdown
Contributor

@AmitMY I will merge this + some changes
I don't think it is a good idea to support runtime dir change. how is that useful? and implementing correctly is complicated and error prone, take a look at menu-types, you have not made any change there, and it will require some in order to work properly with RTL changes at runtime

@manucorporat

Copy link
Copy Markdown
Contributor

@AmitMY I mess up with git, looks like git merger --squash removed you as author... I am sorry about that, just noticed when pushed the changes

@AmitMY

AmitMY commented Apr 23, 2017

Copy link
Copy Markdown
Contributor Author

@manucorporat No problem :) Glad it got merged
I was just about to push some menu-types changes as you suggested, but still testing

Thanks for the merge!

@manucorporat

Copy link
Copy Markdown
Contributor

well, I would wait for the runtime change of dir. Probably something we should look at it once RTL is working properly in ionic, do not focus on that just yet.

Also, I don't want to add more complexity if the change does not bring any value, is it possible in a real app to change the direction?

@AmitMY

AmitMY commented Apr 23, 2017

Copy link
Copy Markdown
Contributor Author

@manucorporat Runtime partially shelved.
Because apps - like mine - offer the ability to change the app's language within settings, there is a change to dir, which means there is a change to side which ultimately mean that there should be runtime changes.

So now there is better support, but not the final version.
I added support for the realtime direction change for menu-types, but I can't make tests to pass. I will create a different PR where we will discuss it.

@AmitMY

AmitMY commented Apr 24, 2017

Copy link
Copy Markdown
Contributor Author

@manucorporat Also, small request - because I don't seem to be able to, can you please add rtl tags for all of the rtl PRs? Much easier to track them that way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants