Skip to content

Deprecated preventDefault behavior will stop working in a future version of WP #49

Description

@goldenapples

Using the query-filter blocks in WordPress 7.0 or with a recent version of the Gutenberg plugin active causes this deprecation warning in the browser console:

Using the synchronous event.preventDefault() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().

This is the result of calling preventDefault() in the view and search methods of the taxonomy filter block (for example, here). The fix proposed is to use the withSyncEvent() higher-order component from @wordpress/interactivity. This is an easy fix, except that withSyncEvent was only added in WP 6.8, and this plugin supports as far back as 6.6.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions