-
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
fix(toggle): swipe gesture applies to knob #27255
Conversation
Run & review this pull request in StackBlitz Codeflow. |
@@ -240,8 +240,6 @@ input { | |||
|
|||
background: var(--track-background); | |||
|
|||
pointer-events: none; |
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.
This is removed from the .toggle-icon
element so users can swipe on the element.
I added another part of the fix so re-requesting reviews:
See 656526f |
Dev build works great in my testing. |
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.
Nice work 👍
Issue number: resolves #27254
What is the current behavior?
The swipe gesture is currently applied to the entire
ion-toggle
element. This was fine for the legacy syntax, but with the modern syntax it means users can swipe on the label text which is not correct.What is the new behavior?
.toggle-icon
element which is the container for the knob for both modern and legacy syntaxes.touch-action: none
to the host of the legacy toggle. This was preventing scrolling from happening on the modern toggle. I double checked with native iOS and you can scroll when a pointer moves over a toggle.The structure of this fix was designed to match what
ion-range
does:ionic-framework/core/src/components/range/range.tsx
Lines 282 to 296 in a874992
Screen.Recording.2023-04-20.at.12.34.53.PM.mov
Screen.Recording.2023-04-20.at.12.35.19.PM.mov
Does this introduce a breaking change?
Other information