feat(item-sliding): added specific animations for ionic#31103
feat(item-sliding): added specific animations for ionic#31103os-davidlourenco wants to merge 8 commits intonextfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6dc87ba to
a247ac5
Compare
c2f1465 to
7468b4c
Compare
thetaPC
left a comment
There was a problem hiding this comment.
Update the branch to be up to sync with next. We had to make changes to the item sliding tests that were causing tests that were failing while you were out. I would recommend reviewing the fix in case your tests need to be updated.
brandyscarney
left a comment
There was a problem hiding this comment.
Left a comment on the ticket!
| if (opening) { | ||
| expandableOption.classList.remove('item-sliding-expandable-snapback'); | ||
| expandableOption.classList.add('item-sliding-expandable-open'); | ||
| } else { | ||
| expandableOption.classList.remove('item-sliding-expandable-open'); | ||
| expandableOption.classList.add('item-sliding-expandable-snapback'); | ||
| } |
There was a problem hiding this comment.
What is the purpose of these classes? There are no styles for them in the scss files.
| z-index: $z-index-item-options + 1; | ||
| pointer-events: none; | ||
| will-change: transform; | ||
| // During drag on native (ios/md), disable transition — matches former inline `transition: none` |
There was a problem hiding this comment.
Shouldn't this go in item-sliding.native.scss if it only applies to native?
There was a problem hiding this comment.
Everything in this file can go in item-sliding.native.scss since it's the same for ios and md.
There was a problem hiding this comment.
Everything in this file can go in item-sliding.native.scss since it's the same for ios and md.
| this.el.classList.remove('item-sliding-ionic-confirm-item-in'); | ||
| this.el.classList.add('item-sliding-ionic-confirm-item-back'); | ||
| this.item.style.transform = 'translate3d(0, 0, 0)'; | ||
| await this.delay(480, signal); |
There was a problem hiding this comment.
Where does 480 come from? Shouldn't it match $ion-transition-time-500?
| this.el.classList.remove('item-sliding-ionic-confirm-item-back'); | ||
| this.el.classList.add('item-sliding-ionic-confirm-item-in'); | ||
| this.item.style.transform = `translate3d(${-offScreenPosition}px, 0, 0)`; | ||
| await this.delay(150, signal); |
| this.el.classList.remove('item-sliding-ionic-confirm-item-back'); | ||
| this.el.classList.add('item-sliding-ionic-confirm-item-in'); |
There was a problem hiding this comment.
Why do we need ionic in the class name? It should be theme-agnostic but it will only apply styles for ionic.
thetaPC
left a comment
There was a problem hiding this comment.
I only reviewed the test. I'll leave the rest to the current reviewers.
| const FULL_ANIMATION_MS = 1100; | ||
|
|
||
| configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr', 'rtl'] }).forEach(({ title, config }) => { | ||
| configs({ modes: ['ios', 'md'], directions: ['ltr', 'rtl'] }).forEach(({ title, config }) => { |
There was a problem hiding this comment.
These are the defaults so we don't need them.
| configs({ modes: ['ios', 'md'], directions: ['ltr', 'rtl'] }).forEach(({ title, config }) => { | |
| configs().forEach(({ title, config }) => { |
| const ionSwipe = await page.spyOnEvent('ionSwipe'); | ||
| const item = page.locator('ion-item-sliding'); | ||
| await expect(item).toBeVisible(); | ||
| await page.waitForChanges(); |
There was a problem hiding this comment.
Why are these changes needed? The tests were passing before without them. I also removed them locally and the tests are passing fine without them.
| /** | ||
| * Test for Ionic theme that has a different full swipe animation behavior. | ||
| */ | ||
| configs({ modes: ['ionic-md'], directions: ['ltr', 'rtl'] }).forEach(({ title, config }) => { |
There was a problem hiding this comment.
The default for directions is ltr and rtl so we don't need to include them.
| configs({ modes: ['ionic-md'], directions: ['ltr', 'rtl'] }).forEach(({ title, config }) => { | |
| configs({ modes: ['ionic-md'] }).forEach(({ title, config }) => { |
| await page.mouse.move(startX, y); | ||
| await page.mouse.down(); | ||
| await page.mouse.move(endX, y, { steps: 2 }); // try 1–3; lower = faster | ||
| await page.mouse.up(); |
There was a problem hiding this comment.
Why are we not using our dragElementBy util? The same question for the other tests.
| const peek = config.direction === 'rtl' ? 120 : -120; | ||
| await dragElementBy(item, page, peek); |
There was a problem hiding this comment.
Would this check be beneficial to add to ios and md?
| expect(openAmount).toBe(0); | ||
| }); | ||
|
|
||
| test('should NOT trigger full swipe animation for non-expandable options', async ({ page }) => { |
There was a problem hiding this comment.
This doesn't seem to be any different from the test on ios and md. Let's just merge them together.
Issue number: resolves internal
What is the current behavior?
The
item-slidinghas the same animations for md, iOS and IonicWhat is the new behavior?
New animations were added for the Ionic theme, including:
item-slidingitem-slidingNew conditions were also included to ensure a smoother experience:
item-slidingby exceeding velocityDoes this introduce a breaking change?
Other information