Skip to content

Conversation

@graue
Copy link
Contributor

@graue graue commented Oct 12, 2024

This lets you reorder media by dragging and dropping, although it's not currently working on mobile Safari.

I'm submitting this as a partial fix for #618, because I think it's useful to at least have this feature on desktop, and I'm not sure when/if I'll have time to debug further on mobile Safari.

Detail on mobile Safari issues

Caniuse says mobile Safari has supported the HTML5 drag and drop API for several years, but not only does my implementation not work, the example from the Safari docs, unmodified, also doesn't work in mobile Safari for me (17.7 on iOS 17.7).

I got dragging and dropping media to sort of work using this polyfill, but with lots of glitches: unreliable dragenter events and media dropping in the wrong place. So this PR doesn't include the polyfill.

@cheeaun cheeaun added the enhancement New feature or request label Oct 14, 2024
@cheeaun
Copy link
Owner

cheeaun commented Oct 14, 2024

I'll keep this on hold for now. Reasons:

  • Drag-and-drop feature was added in Mastodon v4.3's composer. It's pretty new, I would like to observe people's feedback first.
  • Drag-and-drop on the web ain't… great, in my opinion. Definitely require specialised libraries like the most recent pragmatic-dnd which helps to handle all the edge cases, accessibility, etc. I've been thinking of trying it out in the Shortcuts/columns list reordering but always bail out due to the huge bundle sizes. (Honestly would be great if this PR is done on Shortcuts/columns list first and we'll experiment/test it further)
  • I'm not sure if you tested this when editing a post? I haven't look into how the API works for reordering media of existing post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants