Custom ajax event not working on select widget

Created on 11 February 2025, 11 days ago

Problem/Motivation

I'm trying to add a custom ajax event to a field using the Tagify select widget, through a form alter of the node form:

$form['field_product_groups']['widget']['#ajax'] = [
    'event' => 'change',
    'callback' => [$this, 'updateSelects'],
    'wrapper' => $form['#id'],
    'disable-refocus' => true,
];

The ajax event is processed and present in drupalSettings.ajax object when I check this variable in the browser console, but when changing the selected value, no ajax callback is triggered. The same code does work when using the Tagify autocomplete widget. No errors are logged to the console.

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024