- First commit to issue fork.
- Merge request !6689[#3033153] - Block dragging of Layout Builder blocks when contextual links are clicked β (Closed) created by danielveza
- Status changed to Needs review
10 months ago 5:40am 20 February 2024 - π³πΏNew Zealand danielveza Brisbane, AU
This is actually a really quick fix. The Sortable library has a
filter
param which can be used to exclude selectors from triggering the drag behaviour.The issue here is around testing, I'm not sure with the current setup if we can add testing around this
- πΊπΈUnited States smustgrave
Could SortableTestTrait be used and then check that the order is unchanged when trying to grab the contextual link? Probably can extend an existing test.
- π³πΏNew Zealand danielveza Brisbane, AU
Unless I'm mistaken, SortableTestTrait doesn't actually do the drag & drop, it simulates it so that wouldn't work.
However when you mousedown on a sortable element you a class gets added if it's draggable. I may be able to test the class gets added when you mousedown over a draggable element, and does not get added when you mousedown over the .contextual element.
- πΊπΈUnited States smustgrave
I'm not 100% sure either but if that doesn't work I can just put the manual testing results and maybe that's enough
- πΊπΈUnited States smustgrave
So tried the test-only feature and locally but the test is passing without the fix.
- πΊπΈUnited States smustgrave
Letβs just remove the tests and mark it unless you can think of any other example in core that could simulate this
- π³πΏNew Zealand danielveza Brisbane, AU
I've reverted the test coverage, you're correct that is was passing regardless. I didn't realise that waitForElementVisible doesn't throw an exception and I haven't found a good way to do a mouse down + hold
- Status changed to RTBC
10 months ago 4:05am 22 February 2024 - πΊπΈUnited States smustgrave
Manually testing can confirm the issue is fixed. And donβt think itβs something we have to worry about being reverted accidentally.
Thanks for trying the tests!
- Status changed to Fixed
10 months ago 12:40am 3 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.