Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion docs/api/range.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ import IonChangeEvent from '@site/static/usage/v9/range/ion-change-event/index.m

### Using `ionKnobMoveStart` and `ionKnobMoveEnd` {/* #using-ionknobmovestart-and-ionknobmoveend */}

The `ionKnobMoveStart` event emits when the Range knob begins dragging, whether through mouse drag, touch gesture or keyboard interaction. Inversely, `ionKnobMoveEnd` emits when the Range knob is released. Both events emit with the `RangeValue` type and work in combination with the `dualKnobs` property.
The `ionKnobMoveStart` event emits when the Range knob begins dragging, whether through mouse drag, touch gesture or keyboard interaction. Inversely, `ionKnobMoveEnd` emits when the Range knob is released. Both events emit a detail with the current `value` and work in combination with the `dualKnobs` property.

The event detail also includes which knob moved, using the same static identity and dynamic position described in [CSS Shadow Parts](#css-shadow-parts). The `knob` property is the knob's static identity, `'A'` or `'B'`, and does not change if the knobs cross. The `position` property is whether that knob holds the `'lower'` or `'upper'` value. For `ionKnobMoveStart` it is the position before the knob moves, and for `ionKnobMoveEnd` it is the position after, so a knob that starts as the lower knob and is dragged past the other knob reports `'lower'` on start and `'upper'` on end. A Range without `dualKnobs` always reports a `knob` of `'A'` and a `position` of `'lower'`.

import IonKnobMoveEvent from '@site/static/usage/v9/range/ion-knob-move-event/index.mdx';

Expand Down Expand Up @@ -148,6 +150,8 @@ interface RangeChangeEventDetail {
```typescript
interface RangeKnobMoveStartEventDetail {
value: RangeValue;
knob: RangeKnobName;
position: RangeKnobPosition;
}
```

Expand All @@ -156,6 +160,8 @@ interface RangeKnobMoveStartEventDetail {
```typescript
interface RangeKnobMoveEndEventDetail {
value: RangeValue;
knob: RangeKnobName;
position: RangeKnobPosition;
}
```

Expand All @@ -170,6 +176,28 @@ interface RangeCustomEvent extends CustomEvent {
}
```

### RangeKnobMoveStartCustomEvent {/* #rangeknobmovestartcustomevent */}

While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with the `ionKnobMoveStart` event.

```typescript
interface RangeKnobMoveStartCustomEvent extends CustomEvent {
detail: RangeKnobMoveStartEventDetail;
target: HTMLIonRangeElement;
}
```

### RangeKnobMoveEndCustomEvent {/* #rangeknobmoveendcustomevent */}

While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with the `ionKnobMoveEnd` event.

```typescript
interface RangeKnobMoveEndCustomEvent extends CustomEvent {
detail: RangeKnobMoveEndEventDetail;
target: HTMLIonRangeElement;
}
```

## Types {/* #types */}

### RangeValue {/* #rangevalue */}
Expand All @@ -178,6 +206,18 @@ interface RangeCustomEvent extends CustomEvent {
type RangeValue = number | { lower: number; upper: number };
```

### RangeKnobName {/* #rangeknobname */}

```typescript
type RangeKnobName = 'A' | 'B';
```

### RangeKnobPosition {/* #rangeknobposition */}

```typescript
type RangeKnobPosition = 'lower' | 'upper';
```

## Properties {/* #properties */}

<Props />
Expand Down
26 changes: 13 additions & 13 deletions static/code/stackblitz/v9/angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/code/stackblitz/v9/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@angular/platform-browser": "^22.0.0",
"@angular/platform-browser-dynamic": "^22.0.0",
"@angular/router": "^22.0.0",
"@ionic/angular": "9.0.11-dev.11794501674.16819717",
"@ionic/core": "9.0.11-dev.11794501674.16819717",
"@ionic/angular": "9.0.13-dev.11795197602.11ba74b4",
"@ionic/core": "9.0.13-dev.11795197602.11ba74b4",
"ionicons": "8.1.0",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
Expand Down
16 changes: 8 additions & 8 deletions static/code/stackblitz/v9/html/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/code/stackblitz/v9/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "vite preview"
},
"dependencies": {
"@ionic/core": "9.0.11-dev.11794501674.16819717",
"@ionic/core": "9.0.13-dev.11795197602.11ba74b4",
"ionicons": "8.1.0"
},
"devDependencies": {
Expand Down
Loading
Loading