-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat(toast): add stubbed swipeGesture #28380
Conversation
core/src/components/toast/toast.tsx
Outdated
* `bottom`: The Toast can be swiped down to dismiss. | ||
* `middle`: The Toast can be swiped up or down to dismiss. | ||
*/ | ||
@Prop() swipeGesture?: 'vertical'; |
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'm ok with this as-is, but any reason for not specifying the entire type as part of this PR? You'll have to update this again to add top
, bottom
and middle
which will create an additional diff to review vs. being reviewed as part of this.
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 have a reason for not adding one, but I think it makes sense to add one now for the reason you mentioned. Updated in 6c4cae6
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.
What's the recommended way to test this? I wasn't able to test it locally.
Right now this is all stubbed, so manually testing it isn't going to do much since there's no implementation associated with it. (i.e. you won't be able to do The idea behind a stub is to add just enough code to be compiled and show reviewers how this feature will be activated. In other words, this PR demonstrates the interface for the feature (props, types, methods, etc), but the implementation hasn't been added yet. In this particular case, I wanted to focus on the property setup, making it reactive, and calling the code that will create or destroy the gesture on present and dismiss. You could add some logging in |
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.
LGTM
Issue number: resolves #21769 --------- <!-- 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. --> - Added a `swipeGesture` property that allows users to swipe toasts closed. Note: This is a combination of previous PRs #28380 and #28402⚠️ There is a visual glitch on iOS where dragging and having the toast animate back to its opened position causes a flicker. This is an iOS 17 regression and is being tracked in #28467. This bug has been reported to and confirmed by Apple. ## 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. -->⚠️ Give co-author credit to author in #23124 --------- Co-authored-by: evgeniy-skakun <evgeniy-skakun@users.noreply.github.com>
Issue number: N/A
What is the current behavior?
Toast does not support swipe gestures to dismiss.
What is the new behavior?
swipeGesture
property to enable this behaviorIn 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:
Does this introduce a breaking change?
Other information
Note: This PR is missing some build artifacts. I will add those once #28379 is merged and synced into this branch.