-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix: helper function that determines the ion-menu animation side now … #31214
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -319,10 +319,15 @@ export const pointerCoord = (ev: any): { x: number; y: number } => { | |||||||||||||||
| * Given a side, return if it should be on the end | ||||||||||||||||
| * based on the value of dir | ||||||||||||||||
| * @param side the side | ||||||||||||||||
| * @param hostElement the host element | ||||||||||||||||
| * @param isRTL whether the application dir is rtl | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||||||||||
| */ | ||||||||||||||||
| export const isEndSide = (side: Side): boolean => { | ||||||||||||||||
| const isRTL = document.dir === 'rtl'; | ||||||||||||||||
| export const isEndSide = (side: Side, hostElement?: Element): boolean => { | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we get a test for the ancestor- |
||||||||||||||||
| const isRTL = hostElement | ||||||||||||||||
| ? hostElement.closest('[dir]')?.getAttribute('dir') === 'rtl' | ||||||||||||||||
| : document.dir === 'rtl' | ||||||||||||||||
| ; | ||||||||||||||||
|
Comment on lines
+326
to
+329
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is indented with tabs and has the |
||||||||||||||||
|
|
||||||||||||||||
| switch (side) { | ||||||||||||||||
| case 'start': | ||||||||||||||||
| return isRTL; | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
sideChanged()needs the same treatment.menu.tsx:153still callsisEnd(this.side)with no host element, so it resolves fromdocument.dir, while this line now resolves from the element'sdir. In the ancestor-dir="rtl"case those two disagree, andthis.isEndSidefeeds the gesture math (checkEdgeSide,computeDelta) and the animation builders. Can you passthis.elat line 153 too so both call sites agree?