-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(reorder): add new ionReorderStart, ionReorderMove, ionReorderEnd event playgrounds #4149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature-8.7
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -73,6 +73,29 @@ import UpdatingData from '@site/static/usage/v8/reorder/updating-data/index.md'; | |||
|
|||
<UpdatingData /> | |||
|
|||
## Event Handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love these section headings, but I decided to be consistent with how Range documents its events. If we want to change this I can update both components.
|
||
The `ionReorderEnd` event is emitted when the user completes the reorder gesture by removing their pointer from the screen. The event includes the `from` and `to` indices of the item, as well as the `complete` method that should be called to finalize the reorder operation. The `from` index will always be the position of the item when the gesture started, while the `to` index will be its final position. This event will fire even if no items have changed position, in which case the `from` and `to` indices will be the same. | ||
|
||
import ReorderStartEndEvents from '@site/static/usage/v8/reorder/reorder-start-end-events/index.md'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't like how range prefixes ion-
in the directory names but I can update this if we want consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I have a few nit/grammatical comments, but nothing worth blocking for.
@@ -16,27 +16,71 @@ import Slots from '@ionic-internal/component-api/v8/reorder-group/slots.md'; | |||
import EncapsulationPill from '@components/page/api/EncapsulationPill'; | |||
|
|||
|
|||
The reorder group is a container for items using the [reorder](./reorder) component. When the user drags an item and drops it in a new position, the `ionItemReorder` event is dispatched. A handler for this event should be implemented that calls the `complete` method. | |||
The reorder group is a container for items using the [reorder](./reorder) component. When the user drags an item and drops it in the same or a new position, the `ionReorderEnd` event is dispatched. A handler for this event should be implemented that calls the `complete` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reorder group is a container for items using the [reorder](./reorder) component. When the user drags an item and drops it in the same or a new position, the `ionReorderEnd` event is dispatched. A handler for this event should be implemented that calls the `complete` method. | |
The reorder group is a container for items using the [reorder](./reorder) component. When the user drags an item and drops it, the `ionReorderEnd` event is dispatched. A handler for this event should be implemented that calls the `complete` method. |
You can probably just remove this modifier now instead of trying to extend it to be as inclusive as it is without the modifier.
|
||
The `detail` property of the `ionItemReorder` event includes all of the relevant information about the reorder operation, including the `from` and `to` indexes. In the context of reordering, an item moves `from` an index `to` a new index. For example usage of the reorder group, see the [reorder](./reorder) documentation. | ||
The `detail` property of the `ionReorderEnd` event includes all of the relevant information about the reorder operation, including the `from` and `to` indexes. In the context of reordering, an item moves `from` an index `to` a new index. For example usage of the reorder group, see the [reorder](./reorder) documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `detail` property of the `ionReorderEnd` event includes all of the relevant information about the reorder operation, including the `from` and `to` indexes. In the context of reordering, an item moves `from` an index `to` a new index. For example usage of the reorder group, see the [reorder](./reorder) documentation. | |
The `detail` property of the `ionReorderEnd` event includes all of the relevant information about the reorder operation, including the `from` and `to` indexes. In the context of reordering, an item moves `from` an index `to` an index. For example usage of the reorder group, see the [reorder](./reorder) documentation. |
Not necessarily new anymore
|
||
The `ionReorderStart` event is emitted when the user begins a reorder gesture. This event fires when the user taps and holds an item, before any movement occurs. This is useful for preparing the UI for the reorder operation, such as hiding certain elements or updating the visual state of items. For example, icons in list items can be hidden while they are being dragged and shown again when the reorder is complete. | ||
|
||
The `ionReorderEnd` event is emitted when the user completes the reorder gesture by removing their pointer from the screen. The event includes the `from` and `to` indices of the item, as well as the `complete` method that should be called to finalize the reorder operation. The `from` index will always be the position of the item when the gesture started, while the `to` index will be its final position. This event will fire even if no items have changed position, in which case the `from` and `to` indices will be the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the user completes the reorder gesture by removing their pointer from the screen.
I'm a bit confused here. Should this say "when the user completes the reorder gesture by dropping the item or removing their pointer from the screen"?
Changes
Using ionReorderStart and ionReorderEnd
andUsing ionReorderMove
@deprecated
events (this was previously not accounted for at all) and updates the styling for deprecated propsExample of the new styles (the deprecated property was added just to show the visual updates, I did not deprecate
disabled
):Previews