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

File Upload Part 3 - Drag sorting #210

Merged
merged 19 commits into from
Jun 28, 2023
Merged

Conversation

keithtxw
Copy link
Contributor

Changes

  • In this part, we implement the drag sorting behaviour of the file items

  • Notable info

    • Drag sorting is enabled only if there are no items in edit mode
    • While dragging, all items including the upload button is disabled
  • [delete] branch

Additional information

@keithtxw keithtxw requested a review from qroll June 22, 2023 07:56
@keithtxw keithtxw changed the title [Part 3] Drag sorting File Upload Part 3 Drag sorting Jun 22, 2023
@keithtxw keithtxw changed the title File Upload Part 3 Drag sorting File Upload Part 3 - Drag sorting Jun 22, 2023
src/file-upload/types.ts Outdated Show resolved Hide resolved
src/file-upload/file-list.tsx Show resolved Hide resolved
src/file-upload/file-item.tsx Outdated Show resolved Hide resolved
src/file-upload/file-list.tsx Outdated Show resolved Hide resolved
src/file-upload/file-item.styles.tsx Show resolved Hide resolved
@qroll
Copy link
Contributor

qroll commented Jun 27, 2023

on testing, noticed a couple of interaction conflicts

  • keyboard space on action button activates drag mode instead of triggering the action. workaround suggested here is to stop the keydown event propagation
  • when initiating drag on action button, sometimes the component remains stuck in drag mode
    • to replicate, try targeting the button border rather than the icon svg
    • if I set const shouldDisableActions = false it works fine, so I suspect the drag end event isn't triggering for disabled buttons
    • I couldn't find any specific solutions for this, as a workaround is it possible to
      • disable dragging on buttons
      • or keep buttons enabled, but add checks in the event handlers to prevent them from triggering the callback props

@qroll qroll merged commit 95191e0 into file-upload-long-lived Jun 28, 2023
@qroll qroll deleted the file-upload-part-3 branch June 28, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants