Hello,
I have a form that have ajax radios buttons with a throbber that appears when I change selected radio.
It works well on standard theme like Bartik, but the ajax throbber doesn't appears with bootstrap (see my screenshot for full example).
After some investigation, I identified 2 problems :
- First one in bootstrap_form_element(), line 92
case 'after':
$variables['#children'] = ' ' . $prefix . $element['#children'] . $suffix;
$output .= ' ' . theme('form_element_label', $variables) . "\n";
break;
Using $variables['#children'] instead of $output.= (core function) results to put the input tag inside the label tag, which seems not correct. I'm not sure why you modified the function like that, but I think it needs more condition to only apply on what you need.
- The second problem is in js/misc/ajax.js, line 63
$(this.element).append(this.progress.element);
By using .append, you put the throbber div inside the input, which is semantically incorrect. You should use .after() instead. In addition, as the input is inside the label you should even use .parent().after() to make the throbber appears in that case.
So I think there are 2 things to correct. the bootstrap_form_element() first to avoid input inside label in the case of radios (maybe others form elements are concerned but I didn't test), then, the ajax.js file to put the throbber in the correct place for these form elements.
Thank you for reading, see screenshot for more informations.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | bootstrap-fix-throbber-for-radio-and-checkbox-2116135-2.patch | 2.11 KB | valkum |
| bootstrap-throbber-bug.png | 17.84 KB | zmove |
Comments
Comment #1
valkum commentedWill look tomorrow afternoon into it (GMT+2). If anyone got time before, np.
Comment #2
valkum commented@zmove: Thanks for our investigation.
I hope this will fix your issue.
Note:
In js type conversion $(this.element).parents('.pagination') is true also when it returns an empty set, which has length 0, mysteriousComment #3
valkum commentedComment #4
valkum commentedComment #5
zmove commentedHello,
It works like a charm.
Thank you
Alex
Comment #6
markhalliwellThanks @valkum!
Committed 4164fba to 7.x-3.x:
Comment #8
jeff h commentedI believe I am having a similar issue to this one, but with a select list that is populated by AJAX. My specific case is the location module's Country select field which populates via AJAX the State/Province select.
In this Bootstrap theme, no AJAX spinner is ever shown for these select lists, nor is the receiving field (i.e. the State/Province field in my case) ever disabled, so this is quite a significant UX problem.
Comment #9
markhalliwellPlease do not open older closed issues. Create a new one and add this one to the related issues field: https://www.drupal.org/node/add/project-issue/bootstrap#creating_new_issues