mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
style: lint
This commit is contained in:
@ -166,10 +166,7 @@ export class SegmentButton implements ComponentInterface, ButtonInterface {
|
||||
</span>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</button>
|
||||
<div
|
||||
part="indicator"
|
||||
class="segment-button-indicator segment-button-indicator-animated"
|
||||
>
|
||||
<div part="indicator" class="segment-button-indicator segment-button-indicator-animated">
|
||||
<div part="indicator-background" class="segment-button-indicator-background"></div>
|
||||
</div>
|
||||
</Host>
|
||||
|
@ -39,7 +39,7 @@ export class SegmentView implements ComponentInterface {
|
||||
// Emit the scroll direction and distance
|
||||
this.ionSegmentViewScroll.emit({
|
||||
scrollDirection,
|
||||
scrollDistance
|
||||
scrollDistance,
|
||||
});
|
||||
|
||||
const atSnappingPoint = scrollLeft % offsetWidth === 0;
|
||||
|
@ -65,7 +65,9 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
|
||||
await expect(segmentContent).toBeInViewport();
|
||||
});
|
||||
|
||||
test('should scroll to the third content and update the segment value when the second segment content is disabled', async ({ page }) => {
|
||||
test('should scroll to the third content and update the segment value when the second segment content is disabled', async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-segment>
|
||||
|
@ -374,8 +374,7 @@ export class Segment implements ComponentInterface {
|
||||
|
||||
// Calculate the max and min allowed transformations based on the scroll direction
|
||||
const maxTransform = scrollDirection === 'left' ? 0 : segmentRect.width - buttonRect.width;
|
||||
const minTransform = scrollDirection === 'left' ?
|
||||
-(segmentRect.width - buttonRect.width) : 0;
|
||||
const minTransform = scrollDirection === 'left' ? -(segmentRect.width - buttonRect.width) : 0;
|
||||
|
||||
// Clamp the transform value to ensure it doesn't go out of bounds
|
||||
const clampedTransform = Math.max(minTransform, Math.min(transformValue, maxTransform));
|
||||
|
Reference in New Issue
Block a user