Content pfp
Content
@
0 reply
0 recast
0 reaction

Gabriel Ayuso pfp
Gabriel Ayuso
@gabrielayuso.eth
In need of some FE help. I'm using the Select component from shadcn (radix underneath). When expanded, it renders above content on the page. On mobile, when I tap on any select item after expanding it, the tap propagates to the content underneath it. I tried prevent propagation with an onClick on the item and parent.
2 replies
0 recast
13 reactions

Gabriel Ayuso pfp
Gabriel Ayuso
@gabrielayuso.eth
Looked into the radix code. onPointerUp is the handler that is used internally on selection. I added an onPointUp with a console.log to the SelectItem. The logging works but the propagation isn't stopped even if I add e.stopPropagation() in there. 🤔
0 reply
0 recast
0 reaction

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
Radix UI comes with its own focus-trapping behavior so the usual event modifiers likely won’t work. Make sure the anatomy matches the example in the docs and check for unexpected stacking contexts in parents (`position: absolute`, `overflow`, etc.) https://www.radix-ui.com/primitives/docs/components/select#anatomy
1 reply
0 recast
1 reaction