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

@ontouchstart:stopPropagation | @ontouchstart:preventDefault in iOS is not working. #21699

Closed
rwecho opened this issue Apr 8, 2024 · 8 comments
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/iOS 🍎 s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity t/bug Something isn't working

Comments

@rwecho
Copy link

rwecho commented Apr 8, 2024

Description

Stop event propagation.

image

Steps to Reproduce

  1. Create a MAUI Blazor Hybrid project.
  2. Add Block1 and Block2 two div.
  3. Add @ontouchstart:preventDefault @ontouchstart:stopPropagation to Block2
  4. Debug in iOS
<div class="block1">
    block1 hello world


    <div class="block2"
        @ontouchstart:preventDefault
        @ontouchstart:stopPropagation>block 2</div>
</div>

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 17.2

Did you find any workaround?

addEventListener with touchstart to Block2, and in the function with handling e.prentDefault(); e.stopPropagation()

Relevant log output

No response

@rwecho rwecho added the t/bug Something isn't working label Apr 8, 2024
@rwecho
Copy link
Author

rwecho commented Apr 8, 2024

I ran it on iOS simulator not real device.

@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label May 1, 2024
@Eilon
Copy link
Member

Eilon commented May 1, 2024

@rwecho thank you for the detailed info. Can you try the same code in a Blazor Web app and run the app in Safari on iOS (even in the emulator)? Does the same issue take place there?

@mkArtakMSFT mkArtakMSFT added the s/needs-info Issue needs more info from the author label May 3, 2024
@Eilon
Copy link
Member

Eilon commented May 3, 2024

@rwecho can you also let us know what not working means? Does it crash the app? Or does it not respect the touch events?

@rwecho
Copy link
Author

rwecho commented May 4, 2024

@Eilon not working is that the event did not be triggered?

As the above image, if I click the block 2 div, “block1 touch start” should not print.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 4, 2024
@rwecho
Copy link
Author

rwecho commented May 4, 2024

@Eilon I test it on browser, the preventDefault & stopPropagation can't constraint the event bubbling in js.
It's that right? If that would explain it.

@Eilon
Copy link
Member

Eilon commented May 6, 2024

@Eilon I test it on browser, the preventDefault & stopPropagation can't constraint the event bubbling in js. It's that right? If that would explain it.

OK, so you're saying that if you have a regular Blazor Web app and you use Safari to browse to it, it's also not working?

@Eilon Eilon added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels May 6, 2024
Copy link
Contributor

Hi @rwecho. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label May 13, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/iOS 🍎 s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants