Skip to content

Commit 51b1cf0

Browse files
Don't toggle check if clicking the expand buttons. Closes #95
1 parent fb483e3 commit 51b1cf0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

resources/assets/js/facetwp/choices.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ $document.on( 'facetwp-loaded', () => {
3131
wrapper.prepend( input );
3232

3333
// Better visual feedback (automatically check when clicked.)
34-
wrapper.addEventListener( 'click', () => {
34+
wrapper.addEventListener( 'click', ( e ) => {
35+
// Don't toggle if already disabled.
3536
if ( hasClass( wrapper, 'disabled' ) ) {
3637
return;
3738
}
3839

40+
// Don't toggle if clicking the "[+]" or "[-]".
41+
if ( e.target.className === 'facetwp-expand' ) {
42+
return;
43+
}
44+
3945
const foundInput = wrapper.querySelector( 'input' );
4046

4147
foundInput.checked = ! foundInput.checked;

0 commit comments

Comments
 (0)