Skip to content

Commit

Permalink
Patch - Tag filter: Fix exception when used with filter plugin (wet-b…
Browse files Browse the repository at this point in the history
…oew#9777)

When the filter and tag filter plugins were used together, typing anything into the text filter field caused the tag filter plugin to raise TypeError exceptions. Although it didn't noticeably break anything.

The exceptions were caused by some logic introduced in wet-boew#9624 to fix an incompatibility between the tag filter and pagination plugins. An if condition was added to evaluate the source property of the "wb-contentupdated" event's data parameter whenever filter controls were toggled... except data doesn't always exist. Only the tag filter and data JSON plugins make use of data parameters. The filter plugin doesn't.

This fixes the issue by adjusting the if condition to ensure that the data parameter is truthy.

Also revises the edge case examples (to demonstrate that the logic fix doesn't interfere with text filter + pagination scenarios):
* Adds a text filter to example 1
* Adds a second example (based on the normal demo page's second example) with a text filter and pagination
  • Loading branch information
EricDunsworth authored Jul 3, 2024
1 parent f81edda commit 6809bcb
Show file tree
Hide file tree
Showing 3 changed files with 1,307 additions and 199 deletions.
Loading

0 comments on commit 6809bcb

Please sign in to comment.