feat(toast): add swipeGesture - #28442
Merged
Merged
Conversation
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Toast does not support swipe gestures to dismiss. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Adds a `swipeGesture` property to enable this behavior - Creates an HTML playground so I can later write E2E tests - Adds stubbed implementations for creating and destroying the swipe gesture on prop change, present, and dismiss - Adds unit tests to verify that the gesture is being created/destroyed on prop change, present, and dismiss In cf7e897 I moved the toast config tests to separate file. For some reason this was causing issues with my new tests. This might be a Stencil bug given that I got the following error: ```js , getValue = (e, t) => getHostRef(e).$instanceValues$.get(t), setValue = (e, t, a, o) => { ^ TypeError: Cannot read properties of undefined (reading '$instanceValues$') at getValue (/Users/liamdebeasi/Ionic/ionic/core/node_modules/@stencil/core/internal/testing/index.js:508:38) at Toast.get [as position] (/Users/liamdebeasi/Ionic/ionic/core/node_modules/@stencil/core/internal/testing/index.js:538:13) at Toast.dismiss (/Users/liamdebeasi/Ionic/ionic/core/src/components/toast/toast.tsx:208:30) at runNextTicks (node:internal/process/task_queues:60:5) at listOnTimeout (node:internal/timers:533:9) at processTimers (node:internal/timers:507:7) ``` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Note: This PR is missing some build artifacts. I will add those once #28379 is merged and synced into this branch.
liamdebeasi
marked this pull request as ready for review
November 7, 2023 17:06
Contributor
|
Dev build: 7.5.4-dev.11699469920.1af6ea12 |
sean-perkins
approved these changes
Nov 9, 2023
sean-perkins
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Only 2 super minor JSDOC formatting suggestions.
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
This was referenced Nov 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #21769
What is the current behavior?
Toast does not support swipe gestures to dismiss.
What is the new behavior?
swipeGestureproperty that allows users to swipe toasts closed.Note: This is a combination of previous PRs feat(toast): add stubbed swipeGesture #28380 and feat(toast): add swipe gesture implementation #28402
Does this introduce a breaking change?
Other information