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

Dropzone sendbox stuck in droppable state when drop outside of Dropzone #5390

Open
asianswagstorm opened this issue Dec 2, 2024 · 3 comments · May be fixed by #5394
Open

Dropzone sendbox stuck in droppable state when drop outside of Dropzone #5390

asianswagstorm opened this issue Dec 2, 2024 · 3 comments · May be fixed by #5394
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete.

Comments

@asianswagstorm
Copy link

Is it an issue related to Adaptive Cards?

No

Is this an accessibility issue?

No

What version of Web Chat are you using?

Latest production

Which distribution are you using Web Chat from?

Bundle (webchat.js)

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

Browser: Edge (latest)

Which area does this issue affect?

Send box

Which theme pack does this issue affect?

Fluent UI

What is the public URL for the website?

No response

Please describe the bug

Image

Dropping a file outside of the dropbox stuck in drop state,
you can drop the file anywhere in the page not the Dropzone, here its the sendbox where the file should be dropped in.

In this scenario I dropped the file outside of the sendbox, then I am stuck at this state.
This is a UI bug, alternatively I can refresh my chat or drop again.

Do you see any errors in console log?

no

How to reproduce the issue?

  1. Navigate to ...
  2. Click on ...
  3. Type "..." in the send box

What do you expect?

Allow adding a prop to specify the dragenter, dragleave, dragend events.

  • document.addEventListener('dragenter', handleDragEnter, false);
  • document.addEventListener('dragleave', handleDragLeave, false);
  • document.addEventListener('dragend', handleDragEnd, false);

https://github.com/microsoft/BotFramework-WebChat/blob/c3857bf9fb4ba963c50ef32cd03bf9c70f1da70e/packages/fluent-theme/src/components/dropZone/DropZone.tsx

is adding a drag event on the entire document.

In sendbox maybe add a ref prop so that you can only drop at the send box and dropping outside will just reset dropZoneState back to false.

What actually happened?

Dropping a file outside of dropzone dropZoneState stays at droppable, even though no drag event.

Do you have any screenshots or recordings to repro the issue?

Yes, you can drop the file anywhere outside the sendbox
Image

Adaptive Card JSON

Additional context

No response

@asianswagstorm asianswagstorm added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete. labels Dec 2, 2024
@OEvgeny
Copy link
Collaborator

OEvgeny commented Dec 2, 2024

The issue seems to be browser isn't sending dragend event as drop resulted in the new tab opened. This is only my guess though, as the issue description isn't very helpful.

@asianswagstorm
Copy link
Author

asianswagstorm commented Dec 2, 2024

so how can we trigger a dragend instead of opening the file? https://github.com/microsoft/BotFramework-WebChat/blob/c3857bf9fb4ba963c50ef32cd03bf9c70f1da70e/packages/fluent-theme/src/components/dropZone/DropZone.tsx

dragover preventDefault in the DropZone?

@OEvgeny
Copy link
Collaborator

OEvgeny commented Dec 2, 2024

Need to check the best strategy to determine if the drag action is over, then set up a handler on drag start to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants