From 5f2966c4c338028c9e9978323d1a48c550463313 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Fri, 28 Jun 2024 12:30:50 +0200 Subject: [PATCH] Fix clear button. Refs #107 --- dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js b/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js index 7f28cd0..030c43a 100644 --- a/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js +++ b/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js @@ -84,7 +84,8 @@ function dismissRelatedLookupPopup(win, chosenId) { $('.dynamic_raw_id-clear-field').click(function() { const $this = $(this); $this - .closest('.vForeignKeyRawIdAdminField, .vManyToManyRawIdAdminField') + .parent() + .find('.vForeignKeyRawIdAdminField, .vManyToManyRawIdAdminField') .val('') .trigger('change');