Replies: 15 comments 8 replies
-
I hope you can check it or give a opinion @shadcn. |
Beta Was this translation helpful? Give feedback.
-
Do you have a link I can check out to debug? |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply @shadcn. I don't have a example, but I following exactly all the docs of your website. The problem is happening only on iOS devices. If you have a iOS device you can check here https://www.soydiego.com.ar and here you have a video from a iPhone: problem.mp4If I can do something more, let me know. |
Beta Was this translation helpful? Give feedback.
-
Having this issue on my website too, and it appears I'm having the same issue as you: |
Beta Was this translation helpful? Give feedback.
-
For me it also does not work on iOS (17.4). Android I can't test and haven't asked a friend or else. Maybe I'll ask in the future. Confusingly the Toggle on ui.shadcn.com does work properly on iOS, but maybe because it's not an Astro App? |
Beta Was this translation helpful? Give feedback.
-
I'm in the same boat, not working on iOS at all, very weird. (Im using Select and seeing the same behavior) |
Beta Was this translation helpful? Give feedback.
-
For now I opted in using Headless UI's component just to support dropdown in iPhones. Link here for docs Simple example: import { Menu, Transition } from '@headlessui/react'
import { Fragment } from 'react'
const links = [
{ href: '/link-1', label: 'Link 1' },
{ href: '/link-2', label: 'Link 2' },
{ href: '/link-3', label: 'Link 3' },
]
export function DropdownSample() {
return (
<Menu as="div" className="relative inline-block">
<Menu.Button className="inline-flex w-full justify-center rounded-md px-4 py-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75">
Sample Links
</Menu.Button>
<Transition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="transform opacity-0 scale-95"
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<Menu.Items className="absolute right-0 mt-2 w-56 origin-top-right overflow-hidden rounded-md bg-white shadow-lg focus:outline-none">
{links.map((link) => (
<Menu.Item key={link.href} as={Fragment}>
<a href={link.href} className={'flex w-full px-4 py-2'}>
{link.label}
</a>
</Menu.Item>
))}
</Menu.Items>
</Transition>
</Menu>
)
} |
Beta Was this translation helpful? Give feedback.
-
For anyone that needs it. I dug into the underlying issue on Radix as it's component has the same issue. By applying |
Beta Was this translation helpful? Give feedback.
-
Hi! So this bug has probably nothing to do with Shadcn nor Radix... I created a bug ticket in astro: |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry for the delay. No, i'm not using |
Beta Was this translation helpful? Give feedback.
-
I'm not using view transitions, but i've verified my fix works across all use cases on iOS with dropdowns and you can update your component locally until someone submits a PR to fix it holistically. In select.jsx it's as easy as adding the translate classes to the className, the same fix would work on other components that are having the issue on iOS i suspect due to some css translation race conditions. Probably need to investigate the particular reason behind how iOS treats this differently but for now this gets us up and running. |
Beta Was this translation helpful? Give feedback.
-
Exactly I'm using Thanks!! |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I have the EXACT same problem with my project. I can't trigger tooltips + dropdown menus. (iOS safari/chrome). So weird. And the translate-y-0 + translate-x-0 classes didn't work either for me. |
Beta Was this translation helpful? Give feedback.
-
I found a simple workaround that works well in my case. const [dropdownOpen, setDropdownOpen] = React.useState(false);
return (
<DropdownMenu
open={dropdownOpen}
onOpenChange={(val) => setDropdownOpen(val)}
>
<DropdownMenuTrigger
onClick={() => {
setDropdownOpen((val) => !val);
}}
>
trigger
</DropdownMenuTrigger>
<DropdownMenuContent>hi</DropdownMenuContent>
</DropdownMenu>
); |
Beta Was this translation helpful? Give feedback.
-
Try to manipulate style just add: data-[state=off]:bg-transparent data-[state=off]:text-black for example |
Beta Was this translation helpful? Give feedback.
-
I will write here the same I wrote in #2129.
Hi. I'm using
Astro
and I have implemeted the dark mode.All is working perfectly in web / Android but on iOS (real device) when I'm touching the button is not displaying the menu to choose the theme.
I realized if you hold two times the button, the menu appears and start working. It's weird.
You can check it in my website https://www.soydiego.com.ar but remember, the problem is with iOS Phones (no with developer tools)
My code is exactly like the website:
Anyone with same problem?
Beta Was this translation helpful? Give feedback.
All reactions