Overview
Currently, is hard/not possible to scroll within the page when dragging components. This makes it really challenging to re-order elements within the visual preview.
There are two specific problems:
- Scroll-wheel is not working while dragging
- It seems that when dragging an element down, browser automatically scrolls down when the cursor is placed on the bottom of the page when dragging. This doesn't happen on the top of the page.
User interface changes
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | xb-automatic-scrolling-while-dragging.gif | 6.12 MB | balintbrews |
Issue fork experience_builder-3463798
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gauravvvv commentedComment #4
gauravvvv commentedComment #5
fazilitehreem commentedComment #6
wim leersCypress unit tests are failing due to . Please merge in upstream
origin/0.x, #3466580: CI jobs >sometimes< not finding modules/custom/experience_builder should have fixed that particular error.Comment #7
fazilitehreem commentedComment #8
wim leersCypress E2E tests are not passing. 😞
Comment #9
balintbrewsAssigning to myself to review what's been done and update/complete as necessary.
Comment #10
wim leersDiscussed with @jessebaker: it makes sense to expand the scope here slightly to address #3454125-53: Implement temporary design system for the DrupalCon Barcelona demo, point 1.3.
If this issue's MR does not address it, we'll need a follow-up for it.
Comment #11
wim leersThis is in the critical path for #3454094: Milestone 0.1.0: Experience Builder Demo — see #3454125-53: Implement temporary design system for the DrupalCon Barcelona demo.1.3.
Comment #12
kristen polTried the MR for curiosity and it didn't work but I'll be keeping an eye on this one :)
Comment #13
balintbrewsI ended up creating #3470603: Scroll-wheel is not working while dragging to track that as a separate issue. MR is incoming for the other described problem as well as #10.
Comment #16
kristen polI switched to the MR branch and ran
npm run build.If I click the plus and then scroll in the components, it works initially, but when I do scrolling in the main area and go back then it wasn't working.
In the main area, I could scroll down but when I tried scrolling up then it wouldn't go to the top.
I'm on Mac and testing with Chrome. Maybe others will have better luck?
Comment #17
kristen polAlso hovering over hero had the preview "under" the main display area so you can't see it.
Comment #18
kristen polScreenshot of last issue.
Comment #19
balintbrewsThanks, @kristen pol! I can definitely see that I broke the previews! 🤦🏻 The rest I can't reproduce yet, but I'll investigate.
Comment #20
wim leersStressing the importance.
Comment #21
balintbrewsI previously attempted to fix all kinds of scrolling problems under this single issue. That wasn't a good idea: some of them are more important than others and should land faster.
I would like to refocus this issue on the automatic scrolling while dragging components. I updated my MR to reflect that:
I opened two new issues with MRs:
Comment #22
lauriiiComment #23
kristen polThis didn't work for me:
Comment #24
kristen polNote that I could scroll up if I had my cursor in the background grey area rather than in the desktop area.
Comment #25
balintbrews@kristen pol, we are only tackling the automated scroll in this issue. So you should be able to drag a component from the bottom to the top and have the page scroll automatically when you reach the top while dragging when there is more space upwards.
I should have added that this isn't the smoothest of an experience as it could be, and you may need to be a bit patient for it to kick in. It's something that SortableJS provides as a plugin. At this stage, I would say we need to move forward with this, and we can open a follow-up issue if we think we want to make the interaction smoother.
What you're describing in #24 also sounds like you may have tried using the scroll-wheel of your mouse while dragging a component. Is that the case? If so, we have #3470603: Scroll-wheel is not working while dragging to address that.
Comment #26
kristen polThanks. I don’t have a mouse… using laptop touchpad. I did wait a bit but I’ll try again. I only tried going from bottom to top as you described.
Comment #27
kristen polI see what's going on. If I go just below the black header area, then it works. If I go into the black header area, it doesn't. i.e. I was going too far up.
Should it work if you go into that area?
Comment #28
danielvezaPopped a couple of comments on the MR, I agree we should figure out why dragging is blocked by the nav. I suspect it's something to do with the fixed positioning.
I ran some tests locally and bumping the scrollsensitivity up to 100 or so felt like it made the scrolling experience smoother, since thats accounting for the 60px we are losing from the nav blocking the scroll
Comment #29
danielvezaAh interesting, did a search for the fixed element scoll issues in the Sortable JS queue and came across this issue - https://github.com/SortableJS/Sortable/issues/1582
We are on 1.15 so it's not broken for us, we might just need to experiement with forceFallback? I'm off this for the day but leaving these here so I/someone eles can review and see if thats an option for us
Comment #32
jessebaker commentedMerged! Thank you everyone
Comment #33
kristen polThanks!
I have a video that shows the behavior I'm seeing:
https://youtu.be/j46NzjwEfp8
I can work around these but maybe there should be follow-up issues for some of this if there aren't already.
Comment #34
kristen polLauri said I should create an issue so here it is:
#3472650: Improve auto-scrolling when components are dragged
Comment #35
wim leers