Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iamllama
Copy link
Contributor

@iamllama iamllama commented Apr 7, 2025

It's not currently possible to drag/drop anything into a field's plaintext editor, text or otherwise, which is inconvenient for several reasons:

  • When the field is set to "Use HTML editor by default", users have to manually uncollapse the richtext editor and only then drag/drop into that instead
  • When the field's editing font size causes the richtext editor to be dwarfed by its plaintext counterpart, there's little leeway when aiming
  • When (fellow 😅) anki recolor users set it up in such a way that it's hard to see where the richtext editor ends and the plaintext one begins

This pr proposes to allow dragging and dropping over a field's container, instead of just the richtext editor. This impl has several quirks:

  1. The field containers extend beyond the inputs, which seems like a plus given that one of the gripes is it needing to be overly precise
    430796580-5c4014c5-0684-4555-99da-79a1b13b626b
  2. When the field uses the plaintext editor by default, this impl uncollapses and focusses the richtext editor to allow the content to be inserted
    This is necessary given the way pasteHTML currently works. Considering the happy path being drag/dropping multimedia elements, showing the richtext editor doesn't seem too cumbersome. It could be seen as annoying when text is drag/dropped, but as mentioned, users currently need to manually uncollapse the richtext editor as it is

Copy link
Collaborator

@abdnh abdnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. That's a nice improvement!

@dae
Copy link
Member

dae commented Apr 11, 2025

Agreed - this is a nice clean improvement. Thank you!

@dae dae merged commit d9c71a5 into ankitects:main Apr 11, 2025
1 check passed
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.

3 participants