Skip to content
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

bug: Swipe to dismiss not working properly on toast with customized ::part(container) css #29998

Open
3 tasks done
aeharding opened this issue Nov 5, 2024 · 0 comments · May be fixed by #29999
Open
3 tasks done

bug: Swipe to dismiss not working properly on toast with customized ::part(container) css #29998

aeharding opened this issue Nov 5, 2024 · 0 comments · May be fixed by #29999
Labels

Comments

@aeharding
Copy link
Contributor

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

I have some CSS to center the toast message with its icon. Here is the css:

ion-toast::part(container) {
  display: inline-flex;
  transform: translateX(-50%);
  left: 50%;
  position: relative;
}

With this CSS, I can no longer swipe to dismiss unless I start the swipe from over the .toast-container element:

image

This is because the ion-toast has pointer-events: none and it is reset on the .toast-container element with pointer-events: auto.

Expected Behavior

Can swipe from anywhere on the toast, even with custom layout applied to ::part(container)

Steps to Reproduce

  1. Visit https://stackblitz.com/edit/kvqhk5
  2. Open toast
  3. Try to swipe from the far left and right sides of the toast. Observe it doesn't work.
  4. Try to swipe from the center of the toast. Observe it works.

Code Reproduction URL

https://stackblitz.com/edit/kvqhk5

Ionic Info

Latest Ionic Stackblitz

Additional Information

This could be fixed by moving pointer-events: auto from .toast-container to .toast-wrapper. I will make a pr :)

@ionitron-bot ionitron-bot bot added the triage label Nov 5, 2024
@aeharding aeharding linked a pull request Nov 5, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant