Duolith docs

Warnings while reading a page

W0004 Pressable element inside another

Message <element> can be pressed, but it is inside another element that can be pressed

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

A screen reader announces the outer control with the inner one's text and cannot reach the inner one by itself, and a press on the inner one can reach the outer one too. A button, a link, an element with on:press and a component given onPress can each be pressed.

How to fix it

Place the two side by side, or make only one of them pressable.

In a terminal

duolith explain W0004

Mentioned in