Support multiple data-wp-on-window
or data-wp-on-document
directive with the same event
#60683
Labels
[Feature] Interactivity API
API to add frontend interactivity to blocks.
[Packages] Interactivity
/packages/interactivity
[Type] Bug
An existing feature does not function as intended
Currently, both
data-wp-on-window
anddata-wp-on-document
can't be used more than once on the same element and for the same event type. For example, the following code won't work, because browsers don't support duplicated attributes (data-wp-on-window--click
in this case).To fix this, we could use a similar approach to the one in #60661 for
data-wp-on
, i.e., allowing appending an ID to differentiate multiple directives with the same event.The text was updated successfully, but these errors were encountered: