fix(segment-view): allow moving the indicator left on scroll without touch

This commit is contained in:
Brandy Carney
2024-09-25 12:00:52 -04:00
parent 1d645c9f3f
commit c7bae079c2
6 changed files with 91 additions and 13 deletions

View File

@@ -2043,14 +2043,20 @@ export class IonSegmentView {
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['ionSegmentViewScroll']);
proxyOutputs(this, this.el, ['ionSegmentViewScroll', 'ionSegmentViewScrollEnd']);
}
}
export declare interface IonSegmentView extends Components.IonSegmentView {
/**
* Emitted when the segment view is scrolled.
*/
ionSegmentViewScroll: EventEmitter<CustomEvent<{ scrollDirection: string; scrollDistance: number }>>;
/**
* Emitted when the segment view scroll has ended.
*/
ionSegmentViewScrollEnd: EventEmitter<CustomEvent<void>>;
}

View File

@@ -1882,14 +1882,20 @@ export class IonSegmentView {
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['ionSegmentViewScroll']);
proxyOutputs(this, this.el, ['ionSegmentViewScroll', 'ionSegmentViewScrollEnd']);
}
}
export declare interface IonSegmentView extends Components.IonSegmentView {
/**
* Emitted when the segment view is scrolled.
*/
ionSegmentViewScroll: EventEmitter<CustomEvent<{ scrollDirection: string; scrollDistance: number }>>;
/**
* Emitted when the segment view scroll has ended.
*/
ionSegmentViewScrollEnd: EventEmitter<CustomEvent<void>>;
}

View File

@@ -762,7 +762,8 @@ export const IonSegmentContent = /*@__PURE__*/ defineContainer<JSX.IonSegmentCon
export const IonSegmentView = /*@__PURE__*/ defineContainer<JSX.IonSegmentView>('ion-segment-view', defineIonSegmentView, [
'disabled',
'ionSegmentViewScroll'
'ionSegmentViewScroll',
'ionSegmentViewScrollEnd'
]);