E053 — Unsupported native click command

Copy Markdown View Source

For app developers using experimental LiveLift.

A phx-click inside an island can use a literal Phoenix.LiveView.JS call from focus, focus_first, add_class, remove_class, toggle_class, and bounded dispatch calls. Use the bound element or a literal descendant target. Keep the chain to eight calls and the expression to 1,024 bytes.

For example, a document selector fails to compile in an island.

Phoenix.LiveView.JS.focus(to: "#target")

Use an inner target on a container that owns the destination.

Phoenix.LiveView.JS.focus(to: {:inner, "#target"})

The selector can be a simple #id or .class of up to 64 identifier characters after the prefix. The examples are illustrative. The native counter fixture contains tested bindings.

Class commands take one to eight literal names. A name starts with an ASCII letter or underscore and uses up to 64 ASCII letters, digits, underscores and hyphens. Use immediate bindings with the default target selector. For transitions, delayed clicks, document selectors, arbitrary attribute mutations, computed commands and raw command JSON, place the binding outside the island. For state changes inside the island, use a named LiveView event.

For custom events, use a literal app namespace, such as Phoenix.LiveView.JS.dispatch("workspace:preview", bubbles: false). The language guide lists the name and selector rules. A bare browser event name, reserved namespace, payload, blocking option, bubbling, or a pipe with a class mutation requires moving the binding outside the island or changing it to the supported form.