You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[pat-depends] newer versions don't work properly with native select / pat-select2 #1276
In plone.staticresources==2.3.5 installed by Plone==6.1.4pat-depends behaves in a broken manner:
<selectname="myselect" multiple><option>a</option><option>b</option><option>c</option></select><divclass="pat-depends" data-pat-depends="myselect ~= a">Option A selected</div><divclass="pat-depends" data-pat-depends="myselect ~= b">Option B selected</div><divclass="pat-depends" data-pat-depends="myselect ~= c">Option C selected</div>
pat-depends reads the select value from myselect.value which is a single string with the value of the first selected option. In the example above, selecting all options would result in only "Option A selected" being displayed. Selecting all BUT a would result in "Option B selected". This also occurs if binding to a <select class="pat-select2" multiple>.
I am using a select wrapper (https://github.com/Mobius1/Selectr/ - i know is archived but it still does it's job properly) that sends change event on the underlying select when the value changes but the latest version of pat-depends only ever intercepts input. I can make it work if I wrap the Selectr change event and trigger new Event("input") but that seems absurd to me.
I did consider upgrading from Selectr to pat-select2 however, as described above that would also be broken and only partially solve the issues.
I had to downgrade to plone.staticresources==2.2.5 to gain back functionality.
Activity