style: lint

This commit is contained in:
Brandy Carney
2024-09-24 19:55:25 -04:00
parent 699ce9779f
commit 1d645c9f3f
4 changed files with 6 additions and 8 deletions

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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));