File tree 3 files changed +11
-2
lines changed
src/assetbundles/reasons/dist/js
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ ) and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
6
6
7
+ ## 2.2.4 - 2021-01-20
8
+ ### Fixed
9
+ - Fixes an issue where Lightswitch toggle fields would not work properly on Craft 3.5.18+
10
+
7
11
## 2.2.3 - 2020-12-27
8
12
### Fixed
9
13
- Fixes Postgres SQL errors
Original file line number Diff line number Diff line change 2
2
"name" : " mmikkel/reasons" ,
3
3
"description" : " Adds conditionals to field layouts." ,
4
4
"type" : " craft-plugin" ,
5
- "version" : " 2.2.3 " ,
5
+ "version" : " 2.2.4 " ,
6
6
"keywords" : [
7
7
" craft" ,
8
8
" cms" ,
Original file line number Diff line number Diff line change 306
306
case 'craft\\fields\\Lightswitch' :
307
307
$toggleFieldInput = $toggleField . find ( '.input *:input:first' ) ;
308
308
if ( $toggleFieldInput . length > 0 ) {
309
- toggleFieldValue = $toggleFieldInput . val ( ) === '1' ? 'true' : 'false' ;
309
+ // Lightswitch markup changed in Craft 3.5.18
310
+ if ( $toggleFieldInput . is ( 'button' ) ) {
311
+ toggleFieldValue = $toggleFieldInput . attr ( 'aria-checked' ) ;
312
+ } else if ( $toggleFieldInput . is ( 'input' ) ) {
313
+ toggleFieldValue = $toggleFieldInput . val ( ) === '1' ? 'true' : 'false' ;
314
+ }
310
315
}
311
316
break ;
312
317
case 'craft\\fields\\Checkboxes' :
You can’t perform that action at this time.
0 commit comments