Repository: django-hijack/django-hijack (language: python)

Issue:
Django hijack doesnt work with `<span>` in button (icon)
Storry:

For our highly customized django admin we want to have a button in "hijack" button.

Something like this:

```html
{% load i18n l10n hijack %}
{% if request.user|can_hijack:another_user %}

  {% blocktranslate trimmed with username=another_user.get_full_name asvar button_title %}
    impersonate {{ username }}
  {% endblocktranslate %}

  <button
    type="button"
    data-hijack-user="{{ another_user.pk|unlocalize }}"
    data-hijack-next="{{ next }}"
    data-hijack-url="{% url 'hijack:acquire' %}"
    title="{{ button_title|capfirst }}"
    class="btn-outline"
    data-testid="hijack_user_button_{{ another_user.pk }}"
  >
    <span
      class="material-symbols-outlined"
    >
      supervisor_account
    </span>
  </button>
{% endif %}

```

The problem is, if you are "lucky" enough, you can click not on the button, but on the icon.

Then in script you will get an `undefined` user pk, as the `span` has not `user` assigned.

### Temporary fix:
```html
    <span
      class="material-symbols-outlined"
      {#  These are temporery fix, before this PR is merged and included in django hijack: #}
      data-hijack-user="{{ another_user.pk|unlocalize }}"
      data-hijack-next="{{ next }}"
      data-hijack-url="{% url 'hijack:acquire' %}"
      {# Temp fix end #}
    >
      supervisor_account
    </span>
```

### Final fix:
Use "currentTarget"


Discussion / hints:

Fix patch:
diff --git a/hijack/static/hijack/hijack.js b/hijack/static/hijack/hijack.js
index 8a4b43a..470d29c 100644
--- a/hijack/static/hijack/hijack.js
+++ b/hijack/static/hijack/hijack.js
@@ -33,7 +33,7 @@ export function mount (fn, query) {
  * @return {Promise<void>}
  */
 export async function hijack (event) {
-  const element = event.target
+  const element = event.currentTarget
   const form = new FormData()
   form.append('csrfmiddlewaretoken', document.querySelector('input[name=csrfmiddlewaretoken]').value)
   form.append('user_pk', element.dataset.hijackUser)


Test patch:
diff --git a/tests/__tests__/hijack.test.js b/tests/__tests__/hijack.test.js
index 7301dce..59e752d 100644
--- a/tests/__tests__/hijack.test.js
+++ b/tests/__tests__/hijack.test.js
@@ -65,7 +65,7 @@ describe('mount', () => {
 describe('hijack', () => {
   test('hijack', async () => {
     const event = {
-      target: {
+      currentTarget: {
         dataset: {
           hijackUser: '1',
           hijackNext: '/',