-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
List view: add drag cursor to draggable list items #57493
Conversation
Size Change: +23 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
In Chrome I noticed a bug where the cursor doesn't appear randomly for the navigation list view (in the left hand "view" sidebar). Now I can't reproduce 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything checked out. The only thing that bothered me slightly was the grab cursor still appears on the Navigation view when hovering over the expand/contract chevron. It would look better with a pointer. You can still drag the whole thing from that chevron, so not a huge deal.
✅ LGTM
Thanks for testing.
That's a fair point. I can do a follow up and tighten up the CSS selectors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, I like this, I think the grabbing cursor makes a big difference 👍
One thing I noticed is that the cursor jumps a bit for me as I hover between list view items. I think there might be a tiny gap vertically between list view items where the cursor reverts back to a pointer, so it jumps / flickers a bit for me. It's hard to show in a video, but I'm wondering if one way to resolve it could be to move cursor: grab
further up the hierarchy, and then set cursor: pointer
or cursor: auto
for those elements where we want the pointer, such as the block settings menu and the expand / collapse button?
Here's a video of the cursor jumping a little between list view items:
2024-01-04.09.24.35.mp4
What do you think?
I'll look at this in the follow up too. Thank you! 👍🏻 I noticed there was some padding, internal to the |
Ah, good call! Yeah, sounds like a Out of curiosity, why is the |
Because I just type things, and when they kinda work I push the code and wait for you to tell me to make it better. It worked again! Seriously, we don't - the original plan was to show/hide a dragHandle icon onHover and I left the rules in there without reverting. Thanks for picking up on that 💟 @apeatling and @andrewserong - I think I've addressed the pointer cursor over the expander icon, and also the jittery mouse in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, thanks for the follow-ups!
✅ No jumps between blocks anymore
✅ Pointer is used on the expander and block settings menu buttons
✅ When a block is set to have movement disabled, the pointer is used
I noticed that after moving a block, sometimes the cursor in Chrome defaults back to the regular mouse cursor. However moving the mouse cursor out of the list view and back to it restores the grabby hand cursor. It's a very minor thing, and doesn't appear to happen in Safari, so doesn't feel like a blocker for this PR IMO.
2024-01-04.11.06.36.mp4
LGTM! ✨
I also saw this! But it came and went for me, and the I'll keep an eye on it. Thank you! |
Perhaps resolves #33686
What?
When hovering over a list item that can be moved, change the cursor from
pointer
tograb
.Hovering over the list item's ellipsis menu will continue to show the
pointer
cursor.Why?
The intention is to make it a little more obvious to mouse users that the list item is draggable.
How?
Classnames + CSS
Testing Instructions
List view (post and site editor)
2024-01-03.15.11.34.mp4
Navigation
Check in other browsers, e.g., Firefox, Safari, Edge
2024-01-03.15.22.17.mp4
2024-01-03.15.15.33.mp4