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

[wasm] FlipView does not increase SelectedIndex when swiping on mobile devices #15277

Closed
ryanwin98 opened this issue Jan 30, 2024 · 8 comments · Fixed by #16666
Closed

[wasm] FlipView does not increase SelectedIndex when swiping on mobile devices #15277

ryanwin98 opened this issue Jan 30, 2024 · 8 comments · Fixed by #16666
Assignees
Labels
difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers kind/regression Something was working, now it isn't platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Comments

@ryanwin98
Copy link

ryanwin98 commented Jan 30, 2024

Current behavior

When using swipe controls to go between items in the FlipView the SelectedIndex does not update. This causes issues such as the PipsPager not updating correctly

Expected behavior

The SelectedIndex should update when swiping between items in the FlipView

How to reproduce it (as minimally and precisely as possible)

Chefs.-.Google.Chrome.2024-01-30.12-02-56.mp4
  1. Launch an application with FlipView on wasm
  2. In the browser dev tools, select device emulation
  3. Use the swipe controls to go through items in the FlipView

Workaround

N/A

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

5.1.0-dev.1377

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

17.8.5

Relevant plugins

No response

Anything else we need to know?

No response

@ryanwin98 ryanwin98 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jan 30, 2024
@Youssef1313
Copy link
Member

This could be a regression from #14491

@Youssef1313 Youssef1313 added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Jan 31, 2024
@jeromelaban
Copy link
Member

@ryanwin98 can you validate if this is a regression by checking if some of the early Uno 5.0 builds have this issue?

@ryanwin98
Copy link
Author

@jeromelaban rolled by to some earlier version of 5.1 and still viewed this bug, currently downgrading the project to see it the issue still exists in 5.0

@ryanwin98
Copy link
Author

@jeromelaban downgraded to 5.0.19 and i was still facing the same issue

@jeromelaban
Copy link
Member

Thanks. Have you also tried the latest builds of 5.2-dev? It may show differences.

@ryanwin98
Copy link
Author

@jeromelaban upgraded to 5.2.0-dev.426 and the issue is still present

@MartinZikmund MartinZikmund added difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Feb 26, 2024
@Youssef1313 Youssef1313 self-assigned this May 9, 2024
@Youssef1313
Copy link
Member

This is a regression from #14491

@Youssef1313 Youssef1313 added kind/regression Something was working, now it isn't and removed kind/bug Something isn't working labels May 9, 2024
@Youssef1313
Copy link
Member

The original root cause for #14488 is wrong IsIntermediate value (we hardcode it to false):

// We don't have any information from the DOM 'scroll' event about the intermediate vs. final state.
// We could try to rely on the IsPointerPressed state to detect when the user is scrolling and use it.
// This would however not include scrolling due to the inertia which should also be flagged as intermediate.
// The main issue is that the IsPointerPressed be true ONLY when dragging the scrollbars with the mouse,
// as for finger and pen we will get a PointerCancelled which will reset the pressed state to false.
// And it would also requires us to explicitly invoke OnScroll in PointerRelease in order to raise the
// final SV.ViewChanged event with a IsIntermediate == false.
// This is probably safer for now to always consider the scroll as final, even if it introduce a performance cost
// (the SV updates mode is always sync when isIntermediate is false).
var isIntermediate = false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers kind/regression Something was working, now it isn't platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants