- Merge request !552Issue #3203920: Replace Contextual Links BackboneJS usage with VanillaJS equivalent → (Closed) created by bnjmnm
- 🇮🇳India karishmaamin
Fixed some of indentation error. Keeping it Needs work to fix PHPStan error
- 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
Try To Fix the #38 Patch.
- 🇮🇳India vsujeetkumar Delhi
@Prem Suthar, Interdiff is missing in #39, We should add that along with the patch. Its help to the reviewers to find the difference and what are the changes we have made from last patch. Also some Tests fails because some of the files are missing in the patch. Please compare with #26.
- 🇮🇳India vsujeetkumar Delhi
Re-roll patch created for 11.x, We have added some missing JS files according to #26 and removed es6.js files with reference of this document → . Keeps as is "Needs work" because we have some unaddressed comments above.
- last update
over 1 year ago 30,318 pass, 35 fail - 🇬🇧United Kingdom catch
📌 [meta] Deprecate Toolabr module Active will be unblocked soon, which will leave this as the last remaining usage of backbone in Drupal core. It would be great to be able to remove the backbone library from Drupal 12. Bumping this to major.
- 🇺🇸United States smustgrave
Fixed the pipeline so it would run but appears to have broken a few tests.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Fixed the bad reroll which could have been me but also could have been a previous iteration.
Seems to be working locally in manual testing. - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
There were some underscore references left behind. Got rid of those because they're not needed in 2025 - we have native methods
Spot checked some tests locally and its looking good
- 🇺🇸United States nicxvan
There is a functional JS failure that looks relevant, I can't rerun it since a core committer created the branch.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Yep it's a real fail
Closing the contextual link list used to place focus on the trigger but that isn't happening now.
Tried a few things but they all end up in a loop
Will revisit this week - Assigned to larowlan
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Dug some more into the final fail
The issue is that when the dialog is opened from the contextual link that uses ajax and a dlalog, when jQueryUI attempts this codethis.opener = $( this.document[ 0 ].activeElement );
we've already blurred the link and hence there's no focussed element to use as the opener, which means we can't return the focus.
Any ideas @bnjmnm?
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Realized that the order events was being attached were different so re-ordered to ensure that ajax events are added first.
Also worked to reduce the amount of re-renders.
Then also tried using a targeted event (e.g. click.contextualLinks)None of those helped
- 🇫🇷France nod_ Lille
Tried to go back a few commits and fixed a problem with hovering out of a region and contextual links not closing, not sure it's the same issue as #51 but it was broken before and now it's not. Can you let me know how to reproduce the failure with dialog?
opened a new MR to not erase the work in case it's a different bug.
Also all the comments have been removed, would be good to keep them around, they help with understanding what's going on
- 🇫🇷France nod_ Lille
could reproduce the problem with ajax using contextual_test module.
It seems it's the event delegation that used to be in backbone that was making things work. Somewhere it was switched to direct event binding and because there is so much re-rendering the event listeners were trashed and it caused issues apparently.
- 🇫🇷France nod_ Lille
MR is green, need the comments added back for the various function we copy/pasted.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
larowlan → changed the visibility of the branch 3203920-rebased to hidden.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
This is green and should be pretty close, thanks @nod_ for the last fix
- 🇺🇸United States nicxvan
I can't content on the mr for some reason.
Some comments could still use cleanup:
// This uses proxy to look for added instances. Backbone also listened for
// reset and remove, which I'm unsure how do accomplish.Otherwise looks good, JS is not my forte though.
- 🇺🇸United States nicxvan
Ok, I think this is ready.
I tested manually both in 11.x and this branch locally.
I tested block and view contextual links and tested with both mouse and keyboard. As far as I can tell both act exactly the same.I searched for references to backbone, the only references remaining are for toolbar. There are no more references in contextual.
Javascript is not my forte as mentioned, but I am familiar with it, reviewing the code directly I see nothing that looks amiss.
As far as I can tell both larowlan and _nod have worked on this to a non trivial extent.
The only thing I didn't check that may be worth it is performance. I'm not super familiar with JS performance testing so I'll leave that up to a committer to determine if it's necessary.
_nod's comment in 56 make me think the change has been addressed as far as I can tell.