maui icon indicating copy to clipboard operation
maui copied to clipboard

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

Open rwecho opened this issue 10 months ago • 8 comments

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 avatar Apr 08 '24 10:04 rwecho

I ran it on iOS simulator not real device.

rwecho avatar Apr 08 '24 10:04 rwecho

@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?

Eilon avatar May 01 '24 23:05 Eilon

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

Eilon avatar May 03 '24 22:05 Eilon

@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.

rwecho avatar May 04 '24 03:05 rwecho

@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.

rwecho avatar May 04 '24 05:05 rwecho

@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 avatar May 06 '24 16:05 Eilon

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.

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.