Giter Site home page Giter Site logo

Comments (12)

dkniffin avatar dkniffin commented on August 11, 2024 2

Ah yeah.... 🤦 I meant to switch the POST request to dragend but forgot. I think it's actually bad UX as-is and the change should only apply when the mouse button is released.

I'll work on that soon.

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024 2

looks good, the UI still does the little bit where if the horizontal size is small enough and I drag the lines just slightly it starts to endlessly swap rows, but as no network requests are generated this is less of a problem

I'll push this to production, thaaaaaaaaaaaaank you Derek ❤️

from activeadmin_reorderable.

dkniffin avatar dkniffin commented on August 11, 2024 1

@dramalho Interesting. Thank you for reporting and investigating. In my testing, I hadn't tested the index as: :reorderable_table version.

I'll add that to the test suite now and change the querySelectorAll(".aa-reorderable") to querySelectorAll("table.aa-reorderable") and see if that resolves it. If it does, I'll push a patch version w/ the fix

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

Yeah, that should fix it, it's really just a specific JS issue, I just wanted to run it by you in case I was missing something super obvious

thank you Derek 🫶

from activeadmin_reorderable.

dkniffin avatar dkniffin commented on August 11, 2024

@dramalho I fixed it and pushed a v0.3.1. Can you test it and let me know if it resolves the issue for you?

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

ok, re: the original issue, it's great, things are working again but -- I am noticing something new though :) (sorry man, I know this is annoying)

So, if I drag (but don't release the button, or don't release it quick enough) I notice it gets stuck in a look on that dragover handler and keeps swapping lines very quickly, each time initiating a reorder request

image

Unsure if the actual network request should be done at dragend ?

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

this is a new issue though, want me to open a new one?

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

(in the meantime let me try on safari - this was chrome)

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

ahh the wonderful world of frontend dev, safari / firefox are fine, chrome is doing machine gun requests 😭

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

Ok, kinda hard to replicate but I get the same behaviour in Safari as well -- best bet is horizontal size, especially when the index table that AA generates starts to get compressed (< 900px for this particular screen I'm looking at) -- the rows start to flip between each other and because the network request is there (and not when we release the button) it machine guns the server

I know the previous version only acted on the drag when we released the row, one option might be to update the UI on dragover but shoot the network request on dragend ?

from activeadmin_reorderable.

dkniffin avatar dkniffin commented on August 11, 2024

@dramalho Done. Give 0.3.2 a try

from activeadmin_reorderable.

dramalho avatar dramalho commented on August 11, 2024

Third time's a charm!!! I'll test it now 👏

from activeadmin_reorderable.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.