Replies: 1 comment
-
Hey, I am not familiar with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking for help understanding a phenomenon I'm seeing, involving the interplay between radix and swiperjs. I suspect there's something around focusable elements involved, but I'm currently at a loss. Please tell me to ask the Swiper community if it makes more sense - asking here because I'm keen to learn more about the underlying mechanisms.
Code Sandbox
Problem
I have a basic
Swiper
with aSwiperSlide
. Inside, there is a simpleDropdownMenu
with abutton
as a trigger. If thebutton
contains plain, unwrapped text (e.g.<button>click here</button>
), then clicking it works as expected and theDropdownMenu.Contents
is added to the DOM. If thebutton
contains text wrapped in aspan
(<button><span>click here</span></button>
), text wrapped in adiv
, or even ansvg
, then clicking it does not trigger the dropdown to open.The Code Sandbox link contains a
button
with both wrapped and unwrapped text in it. Click each line to see the different behavior.Additional observations
If you add an
onClick()
handler to thebutton
(e.g.onClick={() => console.log("clicked")}
, then this handler is fired when you click the wrapped text, but not when you click the unwrapped text.In the
Swiper
, you can add the propsimulateTouch={false}
(API doc here), and that makes this whole thing magically work as expected - wrapped and unwrapped text both trigger the expected action.Beta Was this translation helpful? Give feedback.
All reactions