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

Dialog unexpectedly closes on a touch device #2964

Open
1 of 3 tasks
dannylin108 opened this issue Oct 8, 2024 · 5 comments
Open
1 of 3 tasks

Dialog unexpectedly closes on a touch device #2964

dannylin108 opened this issue Oct 8, 2024 · 5 comments
Labels

Comments

@dannylin108
Copy link

Description

see this old issue which was closed, not fixed actually (I was able to reproduce it for all releases from 3.9 to 4.2).

#2816

Link to Reproduction (or Detailed Explanation)

https://stackblitz.com/~/github.com/dannylin108/parkui-bug-report

Steps to Reproduce

  1. Open the page on a touch device (Chrome emulation also works)
  2. Open the drawer
  3. Choose a date in the date picker
  4. The drawer unexpectedly closes, but should remain open showing the chosen date.

Ark UI Version

4.2.0

Framework

  • React
  • Solid
  • Vue

Browser

No response

Additional Information

No response

@narsiliko
Copy link

I have the same issue on Ark UI 4.1.2 for React

@cschroeter
Copy link
Member

@narsiliko @dannylin108

We've released a new version. Please re-open the if the issue persist.

@IvanKalinin
Copy link

IvanKalinin commented Nov 8, 2024

@cschroeter

We've released a new version. Please re-open the if the issue persist.

The issue remains after the latest release (v4.3.0)

https://codesandbox.io/p/sandbox/7j72xj

Touching a combobox menu item closes the dialog.
Clicking on it works with no issues.

@marcinzarycki
Copy link

I have run into a similar issue that I think may be related. Reproduced on v4.4.3

While using a touch device (or browser emulation of a touch device), when I press a button that's inside a Dialog, and the click event for that button changes state that causes that button to no longer be rendered, I expect the dialog to remain open, but it closes.

https://codesandbox.io/p/sandbox/ark-ui-dialog-forked-6z8w67
To reproduce in the above reproduction:

  1. Open this on a touch device or use browser emulation of a touch device.
  2. Press the "Open Dialog" button.
  3. Press the "Click to hide this button" button.
    The Dialog should remain open, but it gets closed.

@Xelson
Copy link

Xelson commented Nov 16, 2024

I have run into a similar issue that I think may be related. Reproduced on v4.4.3

While using a touch device (or browser emulation of a touch device), when I press a button that's inside a Dialog, and the click event for that button changes state that causes that button to no longer be rendered, I expect the dialog to remain open, but it closes.

https://codesandbox.io/p/sandbox/ark-ui-dialog-forked-6z8w67 To reproduce in the above reproduction:

  1. Open this on a touch device or use browser emulation of a touch device.
  2. Press the "Open Dialog" button.
  3. Press the "Click to hide this button" button.
    The Dialog should remain open, but it gets closed.

I just did a little research and found out that when the button is unmounted, it ceases to be a child of dialog content, and from the point of view of trackInteractOutside this is an outside action which leads to close of the dialog
https://github.com/chakra-ui/zag/blob/fb6fa8d3da3f607350d9d1608e696f8e12d481fa/packages/utilities/interact-outside/src/index.ts#L101C9-L101C17

I do not know why this happens only on touch devices, but workaround can apply the dom attribute hidden or something similar instead of unmounting the button

@cschroeter cschroeter added the bug label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants