Button checkboxes break ajax views auto-submit

Created on 29 February 2024, 9 months ago
Updated 19 March 2024, 8 months ago

Problem/Motivation

Barrio provides 3 options for checkbox/radio elements: default, sliders, and buttons. When combined with auto-submitting ajax views, the button styling breaks the submit functionality.

Steps to reproduce

  • Create a view with exposed radio button filters.
  • Put the exposed filter in a block and enable ajax.
  • My implementation uses Better Exposed Filters to hide the submit button. But I don't think this is a necessary step in recreating the issue.
  • With the checkbox/radio form styling set to default, this should still work.
  • Change the theme form settings to use button styling on checkbox/radio buttons.
  • Now auto-submit is broken.

Proposed resolution

Remove the autosubmit="false" attribute from the twig template:

    {% if checkbox_style == 'form-button' %}
      <input{{ input_attributes.addClass(inputclass).setAttribute('autocomplete', 'off') }}>
    {% else %}
πŸ› Bug report
Status

Needs review

Version

5.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States sim_1

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024