Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Why does x-trap (AlpineJS) add an outline on the images ?

Hello,

Strange ... when I add x-trap.noscroll="showMenu", it adds a black outline on the images inside the div.

Hmmm ... I should say that the image is the first element inside the div and it receives the focus.

I'd like that no element receives the focus.

Do you have an idea why ?

Thanks.

V

0 likes
1 reply
vincent15000's avatar
vincent15000
OP
Best Answer
Level 63

Well ... it was easy to solve ... I have to add .noautofocus.

<div x-trap.noscroll.noautofocus="showMenu">

Please or to participate in this conversation.