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

[v5] bug: Segment should not emit onChange event until pointer end #20257

Closed
liamdebeasi opened this issue Jan 21, 2020 · 3 comments
Closed

[v5] bug: Segment should not emit onChange event until pointer end #20257

liamdebeasi opened this issue Jan 21, 2020 · 3 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Jan 21, 2020

Bug Report

Ionic version:

[x] 5.0.0-beta.5

Current behavior:

When dragging the new segment design via a gesture, the onChange events are emitted whenever the segment indicator moves from one button to another. This is inconsistent with the native iOS segment spec where the onChange event is emitted only after the user's pointer has been removed from the screen.

Expected behavior:

I would expect that the onChange event is emitted after the user's pointer has been removed from the screen.

Steps to reproduce:

  1. Open https://codepen.io/liamdebeasi/pen/KKwbvJY
  2. Click/tap and drag the segment indicator.
  3. Notice that the "Num times changed" count increases every time the segment indicator moves.

Other information:

This has performance implications as the onChange event may be tied to hiding/showing elements in a user's application. For example, if changing the segment button toggles the visibility of a div, dragging the indicator dozens of times is going to cause dozens of change detections to run in Angular apps. If the onChange event is only fired when the user removes their pointer from the screen, then change detection is only going to run once.

@danieljameswilliams
Copy link

I am still experiencing something related to this issue in 5.0.1

If you scroll while touching a segment, it selects it.
But it also throws this error in console:

[Intervention] Ignored attempt to cancel a touchend event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

@liamdebeasi
Copy link
Contributor Author

liamdebeasi commented Feb 26, 2020

@danieljameswilliams Please open a new issue as this one has already been resolved.

@ionitron-bot
Copy link

ionitron-bot bot commented Mar 27, 2020

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants