Drag- & dropping fields in the field list dialog off by one

tastky's Avatar

tastky

24 May, 2020 10:46 AM

D&D'ing a field in its list dialog ("Fields…") does not position the field at the line indicated but instead one above, or all the way to n-1 if trying to reposition a field to the first position. I guess it's a bug from not counting from 0?

(BTW, the fake upvotes in the questionable decks reported back in April have only gotten more.)

  1. Support Staff 1 Posted by Damien Elmes on 25 May, 2020 04:09 AM

    Damien Elmes's Avatar

    I've passed the report on to the PR author, thanks. The upvotes issue is still on the todo list - I just don't have the time to deal with it at the moment I'm afraid.

  2. 2 Posted by BlueGreenMagick on 25 May, 2020 07:27 AM

    BlueGreenMagick's Avatar

    I can't reproduce this on both 2.1.26 and the latest master on linux. Can I ask you try try doing this without addons (press shift when you launch Anki) and see if there is still a problem?

  3. Support Staff 3 Posted by Damien Elmes on 26 May, 2020 07:34 AM

    Damien Elmes's Avatar

    BlueGreen: it looks like there are two problems:

    • the top is also treated as the viewport, so dragging to the top puts it on the bottom
    • the line indicating the drop location doesn't reflect the actual location - if you hover close to the middle of two elements the line is drawn between them, but moving the cursor further up the upper element before releasing doesn't seem to update the line to reflect the fact that it'll be placed above the upper element
  4. Support Staff 4 Posted by Damien Elmes on 26 May, 2020 07:35 AM

    Damien Elmes's Avatar

    Actually it doesn't even seem that complicated - it just doesn't match the line for me

  5. 5 Posted by BlueGreenMagick on 26 May, 2020 10:12 AM

    BlueGreenMagick's Avatar

    Thanks for the detail Damien. I figured out what the issue was: Looks like at the time I wrote the code, I didn't realize that moving a field from above and from from below should be treated differently. So moving it downwards worked, but moving it up didn't.

  6. 6 Posted by BlueGreenMagick on 26 May, 2020 10:13 AM

    BlueGreenMagick's Avatar

    Submitted a PR with the fix. Sorry about that.

  7. Support Staff 7 Posted by Damien Elmes on 26 May, 2020 10:20 AM

    Damien Elmes's Avatar

    Not a problem - thanks for the quick fix!

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac