-
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
bug: ion-toggle
and rendered label blocks vertical gestures/touch-scrolling
#27254
Comments
Thanks! Mind giving this dev build a shot?
|
Hey Liam, Thanks - Unfortunately, this does not seem to resolve the issue here in my sandbox. I'm going to try a few more times, but as of right now, I have not noticed a change in gestures when interacting with toggles.
|
Make sure |
|
I tried both in my production app and also in the sample repo. |
Let me try a full reinstall of node modules. |
Ok, so I do notice one change. Swiping left-right no longer toggles, but swiping up/down still does not scroll as expected: Screen.Recording.2023-04-21.at.10.44.10.AM.mov |
Good catch! Here's a dev build with another fix: |
Thanks @liamdebeasi - The latest Dev build appears to fix the issue! |
Issue number: resolves #27254 --------- <!-- Please refer to our contributing documentation for any questions on submitting a pull request, or let us know here if you need any help: https://ionicframework.com/docs/building/contributing --> <!-- Some docs updates need to be made in the `ionic-docs` repo, in a separate PR. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#modifying-documentation for details. --> <!-- 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. --> 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? <!-- Please describe the behavior or changes that are being added by this PR. --> - The toggle now creates the gesture on the `.toggle-icon` element which is the container for the knob for both modern and legacy syntaxes. - Moved `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: https://github.com/ionic-team/ionic-framework/blob/a8749929e01b07043631fbc8c522d39cbc3ae798/core/src/components/range/range.tsx#L282-L296 | Modern | Legacy | | - | - | | <video src="https://user-images.githubusercontent.com/2721089/233431240-11f0c94f-d86b-4975-afd5-e534262a6f16.mov"></video> | <video src="https://user-images.githubusercontent.com/2721089/233431275-6c6f7fef-6cc0-4adc-8915-6fd5c3795ade.mov"></video> | ## 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. -->
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
With the new 'modern form syntax'
ion-toggle
now renders or contains its label as a child element. This means that its gesture config is now taking over the entire width of the parent container, and blocks touch/scroll gestures on not just the toggle icon/button, but on the entire label/row. This can lead to some very confusing user interactions.See video:
Screen.Recording.2023-04-20.at.12.08.17.PM.mov
Note, I have not tried it, but I suspect that other elements such as
ion-range
, which also have gestures, may also suffer from this same issue.Expected Behavior
The toggle's label should not be a gesture capturing element.
Steps to Reproduce
Checkout repro url and scroll as seen in video.
Code Reproduction URL
https://github.com/lincolnthree/ionic-bugs/tree/issue-27254
Ionic Info
Ionic:
Ionic CLI : 6.20.3 (/Users/lincoln/.nvm/versions/node/v16.14.0/lib/node_modules/@ionic/cli)
Ionic Framework : not installed
@angular-devkit/build-angular : 15.1.6
@angular-devkit/schematics : 15.1.6
@angular/cli : 15.1.6
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 4.6.3
@capacitor/android : not installed
@capacitor/core : 4.6.3
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run (update available: 1.7.2) : 1.7.1
System:
NodeJS : v16.14.0 (/Users/lincoln/.nvm/versions/node/v16.14.0/bin/node)
npm : 8.3.1
OS : macOS
Additional Information
No response
The text was updated successfully, but these errors were encountered: