feat(segment-view): add swipeGesture property to disable swiping (#30948)

Issue number: resolves #30290

---------

## What is the current behavior?
The segment view swipe gesture can only be disabled by adding the `disabled` property and setting `opacity: 1`.

## What is the new behavior?
- Adds a new property, `swipeGesture`, to disable swiping on the segment view
- Adds an e2e test which verifies the styles blocking the swipe are correctly applied when `swipeGesture` is `false`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

---------

Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
This commit is contained in:
Brandy Smith
2026-02-10 09:59:24 -05:00
committed by GitHub
parent 6e4f60af4c
commit 46806bd6e2
9 changed files with 223 additions and 6 deletions

View File

@@ -2113,14 +2113,14 @@ export declare interface IonSegmentContent extends Components.IonSegmentContent
@ProxyCmp({
inputs: ['disabled']
inputs: ['disabled', 'swipeGesture']
})
@Component({
selector: 'ion-segment-view',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['disabled'],
inputs: ['disabled', 'swipeGesture'],
})
export class IonSegmentView {
protected el: HTMLIonSegmentViewElement;

View File

@@ -1889,14 +1889,14 @@ export declare interface IonSegmentContent extends Components.IonSegmentContent
@ProxyCmp({
defineCustomElementFn: defineIonSegmentView,
inputs: ['disabled']
inputs: ['disabled', 'swipeGesture']
})
@Component({
selector: 'ion-segment-view',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['disabled'],
inputs: ['disabled', 'swipeGesture'],
standalone: true
})
export class IonSegmentView {

View File

@@ -899,6 +899,7 @@ export const IonSegmentContent: StencilVueComponent<JSX.IonSegmentContent> = /*@
export const IonSegmentView: StencilVueComponent<JSX.IonSegmentView> = /*@__PURE__*/ defineContainer<JSX.IonSegmentView>('ion-segment-view', defineIonSegmentView, [
'disabled',
'swipeGesture',
'ionSegmentViewScroll'
], [
'ionSegmentViewScroll'