Skip to content

Commit

Permalink
Pass the reference explicitly to the function to ensure the correct c…
Browse files Browse the repository at this point in the history
…ontext is available.
  • Loading branch information
Deeptanshu Sankhwar committed Nov 27, 2024
1 parent 3bda6c7 commit d46dcea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/ui/sections/raw_membership_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ export function uiSectionRawMembershipEditor(context) {
}


function addMembership(d, role) {
this.blur(); // avoid keeping focus on the button
function addMembership(d, role, domElement) {
if (domElement && typeof domElement.blur === 'function') {
domElement.blur(); // avoid keeping focus on the button
}
_showBlank = false;

function actionAddMembers(relationId, ids, role) {
Expand Down Expand Up @@ -557,7 +559,7 @@ export function uiSectionRawMembershipEditor(context) {
if (d.relation) utilHighlightEntities([d.relation.id], false, context);

var role = context.cleanRelationRole(list.selectAll('.member-row-new .member-role').property('value'));
addMembership(d, role);
addMembership(d, role, this);
}


Expand Down

0 comments on commit d46dcea

Please sign in to comment.